Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'LibGit2Sharp/BranchCollection.cs')
-rw-r--r--LibGit2Sharp/BranchCollection.cs15
1 files changed, 2 insertions, 13 deletions
diff --git a/LibGit2Sharp/BranchCollection.cs b/LibGit2Sharp/BranchCollection.cs
index 422d7ee4..22954329 100644
--- a/LibGit2Sharp/BranchCollection.cs
+++ b/LibGit2Sharp/BranchCollection.cs
@@ -67,21 +67,10 @@ namespace LibGit2Sharp
/// </summary>
/// <param name = "shaOrReferenceName">The sha of the commit, a canonical reference name or the name of the branch to checkout.</param>
/// <returns></returns>
+ [Obsolete("This method will be removed in the next release. Please use Repository.Checkout() instead.")]
public Branch Checkout(string shaOrReferenceName)
{
- // TODO: This does not yet checkout (write) the working directory
-
- Branch branch = this[shaOrReferenceName];
-
- if (branch != null)
- {
- repo.Refs.UpdateTarget("HEAD", branch.CanonicalName);
- return branch;
- }
-
- ObjectId commitId = repo.LookupCommit(shaOrReferenceName).Id;
- repo.Refs.UpdateTarget("HEAD", commitId.Sha);
- return repo.Head;
+ return repo.Checkout(shaOrReferenceName);
}
/// <summary>