From d8a04a467baf2ec0139d214f798f5c0a82dd25cb Mon Sep 17 00:00:00 2001 From: nulltoken Date: Mon, 16 Mar 2015 20:50:16 +0100 Subject: Update libgit2 to 9bbc8f3 https://github.com/libgit2/libgit2/compare/e0902fb...9bbc8f3 --- LibGit2Sharp.Tests/CommitFixture.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'LibGit2Sharp.Tests/CommitFixture.cs') diff --git a/LibGit2Sharp.Tests/CommitFixture.cs b/LibGit2Sharp.Tests/CommitFixture.cs index e86d7da3..18fec45b 100644 --- a/LibGit2Sharp.Tests/CommitFixture.cs +++ b/LibGit2Sharp.Tests/CommitFixture.cs @@ -661,7 +661,9 @@ namespace LibGit2Sharp.Tests { string repoPath = InitNewRepository(); - using (var repo = new Repository(repoPath)) + var identity = Constants.Identity; + + using (var repo = new Repository(repoPath, new RepositoryOptions { Identity = identity })) { string dir = repo.Info.Path; Assert.True(Path.IsPathRooted(dir)); @@ -691,7 +693,13 @@ namespace LibGit2Sharp.Tests // Assert a reflog entry is created on HEAD Assert.Equal(1, repo.Refs.Log("HEAD").Count()); var reflogEntry = repo.Refs.Log("HEAD").First(); - Assert.Equal(author, reflogEntry.Committer); + + Assert.Equal(identity.Name, reflogEntry.Committer.Name); + Assert.Equal(identity.Email, reflogEntry.Committer.Email); + + var now = DateTimeOffset.Now; + Assert.InRange(reflogEntry.Committer.When, now - TimeSpan.FromSeconds(1), now); + Assert.Equal(commit.Id, reflogEntry.To); Assert.Equal(ObjectId.Zero, reflogEntry.From); Assert.Equal(string.Format("commit (initial): {0}", shortMessage), reflogEntry.Message); @@ -805,7 +813,7 @@ namespace LibGit2Sharp.Tests public void CanAmendACommitWithMoreThanOneParent() { string path = SandboxStandardTestRepo(); - using (var repo = new Repository(path)) + using (var repo = new Repository(path, new RepositoryOptions { Identity = Constants.Identity })) { var mergedCommit = repo.Lookup("be3563a"); Assert.NotNull(mergedCommit); @@ -822,10 +830,10 @@ namespace LibGit2Sharp.Tests AssertCommitHasBeenAmended(repo, amendedCommit, mergedCommit); AssertRefLogEntry(repo, "HEAD", - amendedCommit.Id, string.Format("commit (amend): {0}", commitMessage), mergedCommit.Id, - amendedCommit.Committer); + amendedCommit.Id, + Constants.Identity, DateTimeOffset.Now); } } -- cgit v1.2.3