diff options
author | nulltoken <emeric.fermas@gmail.com> | 2013-01-23 14:10:19 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-01-23 14:12:05 +0400 |
commit | 9b71e0f8c203cd1394dff22ea1dfeedc7b841e96 (patch) | |
tree | 2e046b692fa031955ca00a2bde1f0f89c5d64a70 /LibGit2Sharp.Tests/CheckoutFixture.cs | |
parent | c5bb01bc1078d794314e2fcb5fe51daf7428dd05 (diff) |
Introduce OrphanedHeadException
Diffstat (limited to 'LibGit2Sharp.Tests/CheckoutFixture.cs')
-rw-r--r-- | LibGit2Sharp.Tests/CheckoutFixture.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/LibGit2Sharp.Tests/CheckoutFixture.cs b/LibGit2Sharp.Tests/CheckoutFixture.cs index b75c7a63..0ab18740 100644 --- a/LibGit2Sharp.Tests/CheckoutFixture.cs +++ b/LibGit2Sharp.Tests/CheckoutFixture.cs @@ -291,6 +291,19 @@ namespace LibGit2Sharp.Tests } [Fact] + public void CheckingOutAgainstAnUnbornBranchThrows() + { + SelfCleaningDirectory scd = BuildSelfCleaningDirectory(); + + using (var repo = Repository.Init(scd.DirectoryPath)) + { + Assert.True(repo.Info.IsHeadOrphaned); + + Assert.Throws<OrphanedHeadException>(() => repo.Checkout(repo.Head)); + } + } + + [Fact] public void CheckingOutANonExistingBranchThrows() { using (var repo = new Repository(StandardTestRepoWorkingDirPath)) |