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:
authornulltoken <emeric.fermas@gmail.com>2013-01-23 14:10:19 +0400
committernulltoken <emeric.fermas@gmail.com>2013-01-23 14:12:05 +0400
commit9b71e0f8c203cd1394dff22ea1dfeedc7b841e96 (patch)
tree2e046b692fa031955ca00a2bde1f0f89c5d64a70 /LibGit2Sharp.Tests/CheckoutFixture.cs
parentc5bb01bc1078d794314e2fcb5fe51daf7428dd05 (diff)
Introduce OrphanedHeadException
Diffstat (limited to 'LibGit2Sharp.Tests/CheckoutFixture.cs')
-rw-r--r--LibGit2Sharp.Tests/CheckoutFixture.cs13
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))