@matheusbsbs / matheus-bagliano / commits / d8c81dfcaf
Fork 0

tests: test applying criss-cross rename patch

Originally reported by Linus in $gmane/116198 Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michał Kiedrowicz committed Apr 11, 2009 at 17:26 UTC d8c81dfcaf3ac4bab0f0f8f54d2c4ae0425abcbf
1 file changed +38
t/t4130-apply-criss-cross-rename.sh new
+38
@@ -0,0 +1,38 @@
1 +#!/bin/sh
2 +
3 +test_description='git apply handling criss-cross rename patch.'
4 +. ./test-lib.sh
5 +
6 +create_file() {
7 + cnt=0
8 + while test $cnt -le 100
9 + do
10 + cnt=$(($cnt + 1))
11 + echo "$2" >> "$1"
12 + done
13 +}
14 +
15 +test_expect_success 'setup' '
16 + create_file file1 "File1 contents" &&
17 + create_file file2 "File2 contents" &&
18 + git add file1 file2 &&
19 + git commit -m 1
20 +'
21 +
22 +test_expect_success 'criss-cross rename' '
23 + mv file1 tmp &&
24 + mv file2 file1 &&
25 + mv tmp file2
26 +'
27 +
28 +test_expect_success 'diff -M -B' '
29 + git diff -M -B > diff &&
30 + git reset --hard
31 +
32 +'
33 +
34 +test_expect_failure 'apply' '
35 + git apply diff
36 +'
37 +
38 +test_done