apply: fall back on three-way merge
[gitweb.git] / t / t4117-apply-reject.sh
index 659e17c92e474ad5828656f83d28cab2a5ecac64..8e15ecbdfdb497fcaa077fd1e6b3f882c9a46cb4 100755 (executable)
@@ -46,6 +46,14 @@ test_expect_success setup '
        cat file1 >saved.file1
 '
 
+test_expect_success 'apply --reject is incompatible with --3way' '
+       test_when_finished "cat saved.file1 >file1" &&
+       git diff >patch.0 &&
+       git checkout file1 &&
+       test_must_fail git apply --reject --3way patch.0 &&
+       git diff --exit-code
+'
+
 test_expect_success 'apply without --reject should fail' '
 
        if git apply patch.1
@@ -54,7 +62,7 @@ test_expect_success 'apply without --reject should fail' '
                exit 1
        fi
 
-       git diff file1 saved.file1
+       test_cmp file1 saved.file1
 '
 
 test_expect_success 'apply without --reject should fail' '
@@ -65,7 +73,7 @@ test_expect_success 'apply without --reject should fail' '
                exit 1
        fi
 
-       git diff file1 saved.file1
+       test_cmp file1 saved.file1
 '
 
 test_expect_success 'apply with --reject should fail but update the file' '
@@ -79,7 +87,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
                exit 1
        fi
 
-       git diff file1 expected &&
+       test_cmp file1 expected &&
 
        cat file1.rej &&
 
@@ -105,7 +113,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
                echo "file1 still exists?"
                exit 1
        }
-       git diff file2 expected &&
+       test_cmp file2 expected &&
 
        cat file2.rej &&
 
@@ -132,7 +140,7 @@ test_expect_success 'the same test with --verbose' '
                echo "file1 still exists?"
                exit 1
        }
-       git diff file2 expected &&
+       test_cmp file2 expected &&
 
        cat file2.rej &&
 
@@ -151,7 +159,7 @@ test_expect_success 'apply cleanly with --verbose' '
 
        git apply --verbose patch.1 &&
 
-       git diff file1 clean
+       test_cmp file1 clean
 '
 
 test_done