Skip to content

Commit c04e3b1

Browse files
committed
Deploy BareRepositoryException
1 parent 858fa09 commit c04e3b1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

LibGit2Sharp.Tests/RepositoryFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void AccessingTheIndexInABareRepoThrows()
3434
{
3535
using (var repo = new Repository(BareTestRepoPath))
3636
{
37-
Assert.Throws<LibGit2SharpException>(() => repo.Index);
37+
Assert.Throws<BareRepositoryException>(() => repo.Index);
3838
}
3939
}
4040

LibGit2Sharp.Tests/ResetHeadFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void MixedResetInABareRepositoryThrows()
149149
{
150150
using (var repo = new Repository(BareTestRepoPath))
151151
{
152-
Assert.Throws<LibGit2SharpException>(() => repo.Reset(ResetOptions.Mixed));
152+
Assert.Throws<BareRepositoryException>(() => repo.Reset(ResetOptions.Mixed));
153153
}
154154
}
155155
}

LibGit2Sharp/Repository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public Index Index
148148
{
149149
if (index == null)
150150
{
151-
throw new LibGit2SharpException("Index is not available in a bare repository.");
151+
throw new BareRepositoryException("Index is not available in a bare repository.");
152152
}
153153

154154
return index;
@@ -441,7 +441,7 @@ public void Reset(ResetOptions resetOptions, string commitish = "HEAD")
441441

442442
if (resetOptions.Has(ResetOptions.Mixed) && Info.IsBare)
443443
{
444-
throw new LibGit2SharpException("Mixed reset is not allowed in a bare repository");
444+
throw new BareRepositoryException("Mixed reset is not allowed in a bare repository");
445445
}
446446

447447
Commit commit = LookupCommit(commitish);

0 commit comments

Comments
 (0)