Skip to content

Commit db02403

Browse files
committed
Ensure Stage() detects minor changes in a tight loop
1 parent 37bdb63 commit db02403

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
@@ -372,5 +372,25 @@ public void CanStageConflictedIgnoredFiles(string filename, FileStatus expected)
372372
Assert.Equal(expected, repo.RetrieveStatus(filename));
373373
}
374374
}
375+
376+
[Fact]
377+
public void CanSuccessfullyStageTheContentOfAModifiedFileOfTheSameSizeWithinTheSameSecond()
378+
{
379+
string repoPath = InitNewRepository();
380+
381+
using (var repo = new Repository(repoPath))
382+
{
383+
for (int i = 0; i < 10; i++)
384+
{
385+
Touch(repo.Info.WorkingDirectory, "test.txt",
386+
Guid.NewGuid().ToString());
387+
388+
repo.Stage("test.txt");
389+
390+
Assert.DoesNotThrow(() => repo.Commit(
391+
"Commit", Constants.Signature, Constants.Signature));
392+
}
393+
}
394+
}
375395
}
376396
}

0 commit comments

Comments
 (0)