Browse files

Restore support to filter since current orphan branch

  • Loading branch information...
1 parent d31afcd commit e6dbc3a24761ca4660b9759e3d9184d9292ec784 @dahlbyk dahlbyk committed Mar 16, 2013
Showing with 3 additions and 2 deletions.
  1. +1 −1 LibGit2Sharp.Tests/RepositoryFixture.cs
  2. +2 −1 LibGit2Sharp/CommitLog.cs
View
2 LibGit2Sharp.Tests/RepositoryFixture.cs
@@ -174,7 +174,7 @@ private static void AssertInitializedRepository(Repository repo, string expected
Assert.Equal(0, repo.Commits.QueryBy(new Filter { Since = repo.Refs.Head }).Count());
Assert.Equal(0, repo.Commits.QueryBy(new Filter { Since = repo.Head }).Count());
Assert.Equal(0, repo.Commits.QueryBy(new Filter { Since = "HEAD" }).Count());
- Assert.Throws<LibGit2SharpException>(() => repo.Commits.QueryBy(new Filter { Since = expectedHeadTargetIdentifier }).Count());
+ Assert.Equal(0, repo.Commits.QueryBy(new Filter { Since = expectedHeadTargetIdentifier }).Count());
Assert.Null(repo.Head["subdir/I-do-not-exist"]);
View
3 LibGit2Sharp/CommitLog.cs
@@ -271,7 +271,8 @@ private ObjectId DereferenceToCommit(string identifier)
private bool AllowOrphanReference(string identifier)
{
- return string.Equals(identifier, "HEAD", StringComparison.Ordinal);
+ return string.Equals(identifier, "HEAD", StringComparison.Ordinal)
+ || string.Equals(identifier, repo.Head.CanonicalName, StringComparison.Ordinal);
}
private IEnumerable<ObjectId> RetrieveCommitOids(object identifier)

0 comments on commit e6dbc3a

Please sign in to comment.