summaryrefslogtreecommitdiff
path: root/t/t4117-apply-reject.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-08-18 10:14:48 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-08-18 10:14:48 (GMT)
commita2bf404e280b8d56d0efa15bd9700464cf8f0d4d (patch)
treec0ba2232ecf9315c320327c35f86a6b7f66ada64 /t/t4117-apply-reject.sh
parent82e2765f59126f96da6e5dc30adf7c6189e9697d (diff)
downloadgit-a2bf404e280b8d56d0efa15bd9700464cf8f0d4d.zip
git-a2bf404e280b8d56d0efa15bd9700464cf8f0d4d.tar.gz
git-a2bf404e280b8d56d0efa15bd9700464cf8f0d4d.tar.bz2
git-apply --verbose
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t4117-apply-reject.sh')
-rwxr-xr-xt/t4117-apply-reject.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh
index 1cf9a2e..b4de075 100755
--- a/t/t4117-apply-reject.sh
+++ b/t/t4117-apply-reject.sh
@@ -57,6 +57,17 @@ test_expect_success 'apply without --reject should fail' '
diff -u file1 saved.file1
'
+test_expect_success 'apply without --reject should fail' '
+
+ if git apply --verbose patch.1
+ then
+ echo "Eh? Why?"
+ exit 1
+ fi
+
+ diff -u file1 saved.file1
+'
+
test_expect_success 'apply with --reject should fail but update the file' '
cat saved.file1 >file1 &&
@@ -106,4 +117,41 @@ test_expect_success 'apply with --reject should fail but update the file' '
'
+test_expect_success 'the same test with --verbose' '
+
+ cat saved.file1 >file1 &&
+ rm -f file1.rej file2.rej file2 &&
+
+ if git apply --reject --verbose patch.2 >rejects
+ then
+ echo "succeeds with --reject?"
+ exit 1
+ fi
+
+ test -f file1 && {
+ echo "file1 still exists?"
+ exit 1
+ }
+ diff -u file2 expected &&
+
+ cat file2.rej &&
+
+ if test -f file1.rej
+ then
+ echo "file2 should not have been touched"
+ exit 1
+ fi
+
+'
+
+test_expect_success 'apply cleanly with --verbose' '
+
+ git cat-file -p HEAD:file1 >file1 &&
+ rm -f file?.rej file2 &&
+
+ git apply --verbose patch.1 &&
+
+ diff -u file1 clean
+'
+
test_done