summaryrefslogtreecommitdiff
path: root/t/t4111-apply-subdir.sh
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-07-30 18:31:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-08-04 18:21:14 (GMT)
commit60f20d4bb4f56ae90967d810ffb042e9f76b310d (patch)
tree2619bc9cb1966fc402189c2fb4eec65cd1c717cd /t/t4111-apply-subdir.sh
parent60c98d1e80a65c9a893733f7bceda463ef3cb6f7 (diff)
downloadgit-60f20d4bb4f56ae90967d810ffb042e9f76b310d.zip
git-60f20d4bb4f56ae90967d810ffb042e9f76b310d.tar.gz
git-60f20d4bb4f56ae90967d810ffb042e9f76b310d.tar.bz2
t4111 (apply): refresh index before applying patches to it
"git apply", like most plumbing, does not automatically refresh the index file even if it is only stat-dirty. So unless the two "cp" commands in reset_preimage() for a given file happen to have the same time stamp, there will be a spurious error: sub/dir/file: does not match index Refresh the index to eliminate this timing dependency. Noticed by running the test with --valgrind (which slows things down a lot). Reported-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4111-apply-subdir.sh')
-rwxr-xr-xt/t4111-apply-subdir.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t4111-apply-subdir.sh b/t/t4111-apply-subdir.sh
index 60c2237..d6271ae 100755
--- a/t/t4111-apply-subdir.sh
+++ b/t/t4111-apply-subdir.sh
@@ -36,7 +36,8 @@ test_expect_success 'setup: subdir' '
cp "$2" file &&
cp "$2" sub/dir/file &&
cp "$2" sub/dir/b/file &&
- cp "$2" objects/file
+ cp "$2" objects/file &&
+ test_might_fail git update-index --refresh -q
}
'