summaryrefslogtreecommitdiff
path: root/t/t4120-apply-popt.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-10-22 05:09:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-11-05 21:35:46 (GMT)
commitaae1f6acf1984f4ae4453ad299a1fa4d261fb188 (patch)
treef7ed043c9e65e8f29c39cea67abc346e0884011b /t/t4120-apply-popt.sh
parentcefd43b7f9b86b1c5de5216a8a03fac5e611afa9 (diff)
downloadgit-aae1f6acf1984f4ae4453ad299a1fa4d261fb188.zip
git-aae1f6acf1984f4ae4453ad299a1fa4d261fb188.tar.gz
git-aae1f6acf1984f4ae4453ad299a1fa4d261fb188.tar.bz2
test: git-apply -p2 rename/chmod only
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4120-apply-popt.sh')
-rwxr-xr-xt/t4120-apply-popt.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t4120-apply-popt.sh b/t/t4120-apply-popt.sh
index 2b2d00b..579c9e6 100755
--- a/t/t4120-apply-popt.sh
+++ b/t/t4120-apply-popt.sh
@@ -56,4 +56,30 @@ test_expect_success 'apply with too large -p and fancy filename' '
grep "removing 3 leading" err
'
+test_expect_success 'apply (-p2) diff, mode change only' '
+ cat >patch.chmod <<-\EOF &&
+ diff --git a/sub/file1 b/sub/file1
+ old mode 100644
+ new mode 100755
+ EOF
+ chmod 644 file1 &&
+ git apply -p2 patch.chmod &&
+ test -x file1
+'
+
+test_expect_success 'apply (-p2) diff, rename' '
+ cat >patch.rename <<-\EOF &&
+ diff --git a/sub/file1 b/sub/file2
+ similarity index 100%
+ rename from sub/file1
+ rename to sub/file2
+ EOF
+ echo A >expected &&
+
+ cp file1.saved file1 &&
+ rm -f file2 &&
+ git apply -p2 patch.rename &&
+ test_cmp expected file2
+'
+
test_done