File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -56,4 +56,30 @@ test_expect_success 'apply with too large -p and fancy filename' '
56
56
grep "removing 3 leading" err
57
57
'
58
58
59
+ test_expect_success ' apply (-p2) diff, mode change only' '
60
+ cat >patch.chmod <<-\EOF &&
61
+ diff --git a/sub/file1 b/sub/file1
62
+ old mode 100644
63
+ new mode 100755
64
+ EOF
65
+ chmod 644 file1 &&
66
+ git apply -p2 patch.chmod &&
67
+ test -x file1
68
+ '
69
+
70
+ test_expect_success ' apply (-p2) diff, rename' '
71
+ cat >patch.rename <<-\EOF &&
72
+ diff --git a/sub/file1 b/sub/file2
73
+ similarity index 100%
74
+ rename from sub/file1
75
+ rename to sub/file2
76
+ EOF
77
+ echo A >expected &&
78
+
79
+ cp file1.saved file1 &&
80
+ rm -f file2 &&
81
+ git apply -p2 patch.rename &&
82
+ test_cmp expected file2
83
+ '
84
+
59
85
test_done
You can’t perform that action at this time.
0 commit comments