summaryrefslogtreecommitdiff
path: root/tests/diff/racy.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: move racy tests to the indexCarlos Martín Nieto2015-06-221-100/+0
| | | | | They fit there much better, even though we often check by diffing, it's about the behaviour of the index.
* tests: set racy times manuallyCarlos Martín Nieto2015-06-221-6/+26
|
* tests: plug leaks in the racy testCarlos Martín Nieto2015-06-221-1/+9
|
* diff: check files with the same or newer timestampsCarlos Martín Nieto2015-06-221-0/+33
| | | | | | | | | | When a file on the workdir has the same or a newer timestamp than the index, we need to perform a full check of the contents, as the update of the file may have happened just after we wrote the index. The iterator changes are such that we can reach inside the workdir iterator from the diff, though it may be better to have an accessor instead of moving these structs into the header.
* diff: add failing test for racy-git in the indexCarlos Martín Nieto2015-06-161-0/+39
We update the index and then immediately change the contents of the file. This makes the diff think there are no changes, as the timestamp of the file agrees with the cached data. This is however a bug, as the file has obviously changed contents. The test is a bit fragile, as it assumes that the index writing and the following modification of the file happen in the same second, but it's enough to show the issue.