Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2014-06-04 01:30:40 +0400
committernulltoken <emeric.fermas@gmail.com>2015-07-04 20:37:12 +0300
commitdb0240319d68caefe41890273a1c97ed2422fb97 (patch)
treebef516cc96033e6987fd86cbcf6acfdb985e0a9d
parent37bdb63e7894c7475c58b8e4475c3138a7b56f74 (diff)
Ensure Stage() detects minor changes in a tight loop
-rw-r--r--LibGit2Sharp.Tests/StageFixture.cs20
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));
+ }
+ }
+ }
}
}