Skip to content

Commit ea08db7

Browse files
matheustavaresgitster
authored andcommitted
t2080: fix cp invocation to copy symlinks instead of following them
t2080 makes a few copies of a test repository and later performs a branch switch on each one of the copies to verify that parallel checkout and sequential checkout produce the same results. However, the repository is copied with `cp -R` which, on some systems, defaults to following symlinks on the directory hierarchy and copying their target files instead of copying the symlinks themselves. AIX is one example of system where this happens. Because the symlinks are not preserved, the copied repositories have paths that do not match what is in the index, causing git to abort the checkout operation that we want to test. This makes the test fail on these systems. Fix this by copying the repository with the POSIX flag '-P', which forces cp to copy the symlinks instead of following them. Note that we already use this flag for other cp invocations in our test suite (see t7001). With this change, t2080 now passes on AIX. Reported-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Matheus Tavares <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d0e5d35 commit ea08db7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t2080-parallel-checkout-basics.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ do
114114

115115
test_expect_success "$mode checkout" '
116116
repo=various_$mode &&
117-
cp -R various $repo &&
117+
cp -R -P various $repo &&
118118
119119
# The just copied files have more recent timestamps than their
120120
# associated index entries. So refresh the cached timestamps

0 commit comments

Comments
 (0)