diff options
author | nulltoken <emeric.fermas@gmail.com> | 2014-06-04 01:30:40 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2015-07-04 20:37:12 +0300 |
commit | db0240319d68caefe41890273a1c97ed2422fb97 (patch) | |
tree | bef516cc96033e6987fd86cbcf6acfdb985e0a9d | |
parent | 37bdb63e7894c7475c58b8e4475c3138a7b56f74 (diff) |
Ensure Stage() detects minor changes in a tight loop
-rw-r--r-- | LibGit2Sharp.Tests/StageFixture.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/LibGit2Sharp.Tests/StageFixture.cs b/LibGit2Sharp.Tests/StageFixture.cs index 3118a623..9a6c6248 100644 --- a/LibGit2Sharp.Tests/StageFixture.cs +++ b/LibGit2Sharp.Tests/StageFixture.cs @@ -372,5 +372,25 @@ namespace LibGit2Sharp.Tests 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)); + } + } + } } } |