Skip to content

Commit 5386591

Browse files
committed
Ensure Stage() detects minor changes in a tight loop
1 parent 9be49f8 commit 5386591

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

LibGit2Sharp.Tests/StageFixture.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,5 +334,25 @@ public void CanStageIgnoredPaths(string path)
334334
Assert.Equal(FileStatus.Added, repo.RetrieveStatus(path));
335335
}
336336
}
337+
338+
[Fact]
339+
public void CanSuccessfullyStageTheContentOfAModifiedFileOfTheSameSizeWithinTheSameSecond()
340+
{
341+
string repoPath = InitNewRepository();
342+
343+
using (var repo = new Repository(repoPath))
344+
{
345+
for (int i = 0; i < 10; i++)
346+
{
347+
Touch(repo.Info.WorkingDirectory, "test.txt",
348+
Guid.NewGuid().ToString());
349+
350+
repo.Stage("test.txt");
351+
352+
Assert.DoesNotThrow(() => repo.Commit(
353+
"Commit", Constants.Signature, Constants.Signature));
354+
}
355+
}
356+
}
337357
}
338358
}

0 commit comments

Comments
 (0)