Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,11 @@ protected static void AssertRefLogEntry(IRepository repo, string canonicalName,
Assert.Equal(@from ?? ObjectId.Zero, reflogEntry.From);

Assert.Equal(committer.Email, reflogEntry.Committer.Email);
Assert.InRange(reflogEntry.Committer.When, before, DateTimeOffset.Now);

// When verifying the timestamp range, give a little more room on the 'before' side.
// Git or file system datetime truncation seems to cause these stamps to jump up to a second earlier
// than we expect. See https://github.com/libgit2/libgit2sharp/issues/1764
Assert.InRange(reflogEntry.Committer.When, before - TimeSpan.FromSeconds(1), DateTimeOffset.Now);
}

protected static void EnableRefLog(IRepository repository, bool enable = true)
Expand Down