Skip to content

Commit

Permalink
git-p4: fix copy detection test
Browse files Browse the repository at this point in the history
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 <vitor.hda@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Vitor Antunes authored and Junio C Hamano committed Mar 28, 2015
1 parent 83e085a commit 138ce9c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion t/t9814-git-p4-rename.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ test_expect_success 'detect copies' '
git commit -a -m "Copy file2 to file11" &&
git diff-tree -r -C --find-copies-harder HEAD &&
src=$(git diff-tree -r -C --find-copies-harder HEAD | sed 1d | cut -f2) &&
test "$src" = file10 &&
case "$src" in
file2 | file10) : ;; # happy
*) false ;; # not
esac &&
git config git-p4.detectCopiesHarder true &&
git p4 submit &&
p4 filelog //depot/file11 &&
Expand Down

0 comments on commit 138ce9c

Please sign in to comment.