Skip to content

Commit 138ce9c

Browse files
vhdagitster
authored andcommitted
git-p4: fix copy detection test
File file11 is copied from file2 and diff-tree correctly reports this file as its the source. But it is possible that the diff-tree algorithm detects file10, which was also copied from file2, as the origin of the new file. This fix uses a case statement to support both files as the source of file11, as was done in other tests in this file. Signed-off-by: Vitor Antunes <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 83e085a commit 138ce9c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

t/t9814-git-p4-rename.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ test_expect_success 'detect copies' '
163163
git commit -a -m "Copy file2 to file11" &&
164164
git diff-tree -r -C --find-copies-harder HEAD &&
165165
src=$(git diff-tree -r -C --find-copies-harder HEAD | sed 1d | cut -f2) &&
166-
test "$src" = file10 &&
166+
case "$src" in
167+
file2 | file10) : ;; # happy
168+
*) false ;; # not
169+
esac &&
167170
git config git-p4.detectCopiesHarder true &&
168171
git p4 submit &&
169172
p4 filelog //depot/file11 &&

0 commit comments

Comments
 (0)