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 <vitor.hda@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vitor Antunes committed
Mar 28, 2015 at 00:03 UTC
138ce9c29f622ea962ee3ed676dd137e20397fcf
1 file changed
+4
-1
t/t9814-git-p4-rename.sh
+4
-1
@@ -163,7 +163,10 @@ test_expect_success 'detect copies' '
163
git commit -a -m "Copy file2 to file11" &&
164
git diff-tree -r -C --find-copies-harder HEAD &&
165
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 &&
170
git config git-p4.detectCopiesHarder true &&
171
git p4 submit &&
172
p4 filelog //depot/file11 &&