summaryrefslogtreecommitdiff
path: root/tests/index/racy.c
Commit message (Collapse)AuthorAgeFilesLines
* index::racy: force racy entryEdward Thomson2016-03-081-19/+12
| | | | | Instead of hoping that we can get a racy entry by going real fast and praying real hard, just create a racy entry.
* tests: use legitimate object idsEdward Thomson2016-02-281-0/+4
| | | | | Use legitimate (existing) object IDs in tests so that we have the ability to turn on strict object validation when running tests.
* win32: introduce p_timeval that isn't stupidEdward Thomson2016-02-121-1/+1
| | | | | Windows defines `timeval` with `long`, which we cannot sanely cope with. Instead, use a custom timeval struct.
* typos in commentsDmitriy Olshevskiy2015-12-211-1/+1
|
* tests: fix warning for nested struct initializationPatrick Steinhardt2015-11-301-1/+1
|
* Fix some warningsJacques Germishuys2015-11-201-1/+0
|
* racy: make git_index_read_index handle racinessEdward Thomson2015-11-161-0/+48
| | | | | | | | | | | Ensure that `git_index_read_index` clears the uptodate bit on files that it modifies. Further, do not propagate the cache from an on-disk index into another on-disk index. Although this should not be done, as `git_index_read_index` is used to bring an in-memory index into another index (that may or may not be on-disk), ensure that we do not accidentally bring in these bits when misused.
* racy: ensure git_index_read_tree clears uptodateEdward Thomson2015-11-161-0/+28
| | | | | Ensure that `git_index_read_tree` clears the uptodate bit on files that it modifies.
* index: test for smudged entries on write onlyEdward Thomson2015-11-161-7/+35
| | | | | | | | | | | | | | | | Test that entries are only smudged when we write the index: the entry smudging is to prevent us from updating an index in a way that it would be impossible to tell that an item was racy. Consider when we load an index: any entries that have the same (or newer) timestamp than the index itself are considered racy, and are subject to further scrutiny. If we *save* that index with the same entries that we loaded, then the index would now have a newer timestamp than the entries, and they would no longer be given that additional scrutiny, failing our racy detection! So test that we smudge those entries only on writing the new index, but that we can detect them (in diff) without having to write.
* index: don't detect raciness in uptodate entriesEdward Thomson2015-11-161-0/+77
| | | | | | | | | | | Keep track of entries that we believe are up-to-date, because we added the index entries since the index was loaded. This prevents us from unnecessarily examining files that we wrote during the cleanup of racy entries (when we smudge racily clean files that have a timestamp newer than or equal to the index's timestamp when we read it). Without keeping track of this, we would examine every file that we just checked out for raciness, since all their timestamps would be newer than the index's timestamp.
* diff/index: respect USE_NSEC for racily clean file detectionAxel Rasmussen2015-09-181-8/+8
|
* index test: include repository.h for declEdward Thomson2015-06-291-0/+1
|
* index, iterator, fetchhead: plug leaksleaksCarlos Martín Nieto2015-06-261-1/+4
|
* index: add a diff test for smudging a file which becomes emptyCarlos Martín Nieto2015-06-221-0/+43
| | | | | Even though the file is empty and thus the size in the entry matches, we should be able to detect it as a difference.
* tests: move racy tests to the indexCarlos Martín Nieto2015-06-221-0/+100
They fit there much better, even though we often check by diffing, it's about the behaviour of the index.