Skip to content

Commit

Permalink
t7001: fix "git mv" test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jul 29, 2008
1 parent c297432 commit 65c35b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions t/t7001-mv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ test_expect_success 'git mv should overwrite symlink to a file' '
! test -e moved &&
test -f symlink &&
test "$(cat symlink)" = 1 &&
git update-index --refresh &&
git diff-files --quiet
'
Expand All @@ -202,6 +203,7 @@ test_expect_success 'git mv should overwrite file with a symlink' '
git mv -f symlink moved &&
! test -e symlink &&
test -h moved &&
git update-index --refresh &&
git diff-files --quiet
'
Expand Down

0 comments on commit 65c35b2

Please sign in to comment.