summaryrefslogtreecommitdiff
path: root/t/t4127-apply-same-fn.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-11-02 13:17:43 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-11-02 13:17:43 -0800
commitc23cd78e8127a2f80cc0357994209bc1bb81a4fe (patch)
treeb8f06e459c5ede03d54de4fb27eecb53585799b0 /t/t4127-apply-same-fn.sh
parentMerge branch 'sc/sequencer-gpg-octopus' (diff)
parentapply: when -R, also reverse list of sections (diff)
downloadtgif-c23cd78e8127a2f80cc0357994209bc1bb81a4fe.tar.xz
Merge branch 'jt/apply-reverse-twice'
"git apply -R" did not handle patches that touch the same path twice correctly, which has been corrected. This is most relevant in a patch that changes a path from a regular file to a symbolic link (and vice versa). * jt/apply-reverse-twice: apply: when -R, also reverse list of sections
Diffstat (limited to 't/t4127-apply-same-fn.sh')
-rwxr-xr-xt/t4127-apply-same-fn.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t4127-apply-same-fn.sh b/t/t4127-apply-same-fn.sh
index 972946c174..305b7e649e 100755
--- a/t/t4127-apply-same-fn.sh
+++ b/t/t4127-apply-same-fn.sh
@@ -32,6 +32,10 @@ test_expect_success 'apply same filename with independent changes' '
test_expect_success 'apply same filename with overlapping changes' '
git reset --hard &&
+
+ # Store same_fn so that we can check apply -R in next test
+ cp same_fn same_fn1 &&
+
modify "s/^d/z/" same_fn &&
git diff > patch0 &&
git add same_fn &&
@@ -43,6 +47,11 @@ test_expect_success 'apply same filename with overlapping changes' '
test_cmp same_fn same_fn2
'
+test_expect_success 'apply same filename with overlapping changes, in reverse' '
+ git apply -R patch0 &&
+ test_cmp same_fn same_fn1
+'
+
test_expect_success 'apply same new filename after rename' '
git reset --hard &&
git mv same_fn new_fn &&