diff options
author | nulltoken <emeric.fermas@gmail.com> | 2013-01-23 13:16:56 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-01-23 14:11:48 +0400 |
commit | c5bb01bc1078d794314e2fcb5fe51daf7428dd05 (patch) | |
tree | 1e4c4136e534595ae3307f78dc4b25f8f8d820f7 | |
parent | 9a9f7d452c3a8232d57c6a5e25fe0dacce7df6de (diff) |
Enhance checkout test coverage
-rw-r--r-- | LibGit2Sharp.Tests/CheckoutFixture.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/LibGit2Sharp.Tests/CheckoutFixture.cs b/LibGit2Sharp.Tests/CheckoutFixture.cs index bc733776..b75c7a63 100644 --- a/LibGit2Sharp.Tests/CheckoutFixture.cs +++ b/LibGit2Sharp.Tests/CheckoutFixture.cs @@ -526,13 +526,17 @@ namespace LibGit2Sharp.Tests repo.Index.Stage(fullPath); repo.Commit("2nd commit", Constants.Signature, Constants.Signature); + Assert.False(repo.Info.IsHeadDetached); + initial.Checkout(); // Head should point at initial commit. Assert.Equal(repo.Head.Tip, initialCommit); Assert.False(repo.Index.RetrieveStatus().IsDirty); + // Verify that HEAD is detached. Assert.Equal(repo.Refs["HEAD"].TargetIdentifier, initial.Tip.Sha); + Assert.True(repo.Info.IsHeadDetached); } } @@ -552,7 +556,7 @@ namespace LibGit2Sharp.Tests // Verify that HEAD is detached. Assert.Equal(repo.Refs["HEAD"].TargetIdentifier, repo.Branches["origin/master"].Tip.Sha); - + Assert.True(repo.Info.IsHeadDetached); } } |