@matheusbsbs / matheus-bagliano / commits / 65c35b2256
Fork 0

t7001: fix "git mv" test

The test assumed that we can keep the cached stat information fresh across rename(2); many filesystems however update st_ctime (and POSIX allows them to do so), and that assumption does not hold. We can explicitly refresh the index for the purpose of these tests. The only thing we are interested in is the staged contents and the mode bits are preserved across "git mv". Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jul 28, 2008 at 22:27 UTC 65c35b2256ecbfaebcf04559fe6070807646afff
1 file changed +2
t/t7001-mv.sh
+2
@@ -185,6 +185,7 @@ test_expect_success 'git mv should overwrite symlink to a file' '
185 ! test -e moved &&
186 test -f symlink &&
187 test "$(cat symlink)" = 1 &&
188 + git update-index --refresh &&
189 git diff-files --quiet
190
191 '
@@ -202,6 +203,7 @@ test_expect_success 'git mv should overwrite file with a symlink' '
203 git mv -f symlink moved &&
204 ! test -e symlink &&
205 test -h moved &&
206 + git update-index --refresh &&
207 git diff-files --quiet
208
209 '