From ff47537557f0ac1919e77c5cb21f36f2e98425de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 17 Jun 2015 14:34:10 +0200 Subject: diff: check files with the same or newer timestamps 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. --- tests/diff/workdir.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/diff/workdir.c') diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c index 6b72f3286..3ca82e733 100644 --- a/tests/diff/workdir.c +++ b/tests/diff/workdir.c @@ -1623,6 +1623,8 @@ void test_diff_workdir__can_update_index(void) /* now if we do it again, we should see fewer OID calculations */ + /* tick again as the index updating from the previous diff might have reset the timestamp */ + tick_index(index); basic_diff_status(&diff, &opts); cl_git_pass(git_diff_get_perfdata(&perf, diff)); -- cgit v1.2.3