diff --git a/LibGit2Sharp.Tests/StageFixture.cs b/LibGit2Sharp.Tests/StageFixture.cs index 3118a6237..9a6c6248a 100644 --- a/LibGit2Sharp.Tests/StageFixture.cs +++ b/LibGit2Sharp.Tests/StageFixture.cs @@ -372,5 +372,25 @@ public void CanStageConflictedIgnoredFiles(string filename, FileStatus expected) Assert.Equal(expected, repo.RetrieveStatus(filename)); } } + + [Fact] + public void CanSuccessfullyStageTheContentOfAModifiedFileOfTheSameSizeWithinTheSameSecond() + { + string repoPath = InitNewRepository(); + + using (var repo = new Repository(repoPath)) + { + for (int i = 0; i < 10; i++) + { + Touch(repo.Info.WorkingDirectory, "test.txt", + Guid.NewGuid().ToString()); + + repo.Stage("test.txt"); + + Assert.DoesNotThrow(() => repo.Commit( + "Commit", Constants.Signature, Constants.Signature)); + } + } + } } }