Imported Upstream version 2.30.0
[platform/upstream/git.git] / t / t4127-apply-same-fn.sh
index 972946c..305b7e6 100755 (executable)
@@ -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 &&