diff options
author | Keith Dahlby <dahlbyk@gmail.com> | 2012-04-21 04:44:27 +0400 |
---|---|---|
committer | Keith Dahlby <dahlbyk@gmail.com> | 2012-04-21 04:44:27 +0400 |
commit | 186ca1782f4346b4ed9f904103a393f1abfa2c1e (patch) | |
tree | 616bfabb7e0e0c3bf78c2c4e6f06446df0fcb4c5 /LibGit2Sharp/BranchCollection.cs | |
parent | d1993af681c2edd61cdc1440d2cb7d5de83522de (diff) |
Move Checkout() to Repository
Closes #107
Diffstat (limited to 'LibGit2Sharp/BranchCollection.cs')
-rw-r--r-- | LibGit2Sharp/BranchCollection.cs | 15 |
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> |