We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 296ee5d commit 1533ddfCopy full SHA for 1533ddf
LibGit2Sharp.Tests/RepositoryFixture.cs
@@ -26,6 +26,7 @@ public void CanCreateBareRepo()
26
Assert.Null(repo.Info.WorkingDirectory);
27
Assert.Equal(Path.GetFullPath(repoPath), repo.Info.Path);
28
Assert.True(repo.Info.IsBare);
29
+ Assert.Throws<BareRepositoryException>(() => { var idx = repo.Index; });
30
31
AssertInitializedRepository(repo, "refs/heads/master");
32
LibGit2Sharp/Repository.cs
@@ -231,7 +231,7 @@ public Index Index
231
throw new BareRepositoryException("Index is not available in a bare repository.");
232
}
233
234
- return index.Value;
+ return index != null ? index.Value : null;
235
236
237
0 commit comments