diff options
author | Junio C Hamano <junkio@cox.net> | 2006-08-18 03:10:19 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-08-18 03:10:19 -0700 |
commit | 82e2765f59126f96da6e5dc30adf7c6189e9697d (patch) | |
tree | 643bafe0c3fab4f9a0fdc784132dde52f7fae823 /t/t4117-apply-reject.sh | |
parent | 57dc397cff09bfabd79ddbc38b704cdd0c2bc6e3 (diff) | |
download | git-82e2765f59126f96da6e5dc30adf7c6189e9697d.tar.gz |
git-apply --reject: send rejects to .rej files.
... just like everybody else does, instead of sending it to the standard
output, which was just silly.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t4117-apply-reject.sh')
-rwxr-xr-x | t/t4117-apply-reject.sh | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh index 3362819c3a..1cf9a2e7a7 100755 --- a/t/t4117-apply-reject.sh +++ b/t/t4117-apply-reject.sh @@ -23,6 +23,12 @@ test_expect_success setup ' echo $i done >file1 && git diff >patch.1 && + cat file1 >clean && + + for i in 1 E 2 3 4 5 6 7 8 9 10 11 12 C 13 14 15 16 17 18 19 20 F 21 + do + echo $i + done >expected && mv file1 file2 && git update-index --add --remove file1 file2 && @@ -53,25 +59,30 @@ test_expect_success 'apply without --reject should fail' ' test_expect_success 'apply with --reject should fail but update the file' ' - cat saved.file1 >file1 + cat saved.file1 >file1 && + rm -f file1.rej file2.rej && - if git apply --reject patch.1 >rejects + if git apply --reject patch.1 then echo "succeeds with --reject?" exit 1 fi - cat rejects - for i in 1 E 2 3 4 5 6 7 8 9 10 11 12 C 13 14 15 16 17 18 19 20 F 21 - do - echo $i - done >expected.file1 && - diff -u file1 expected.file1 + diff -u file1 expected && + + cat file1.rej && + + if test -f file2.rej + then + echo "file2 should not have been touched" + exit 1 + fi ' test_expect_success 'apply with --reject should fail but update the file' ' - cat saved.file1 >file1 + cat saved.file1 >file1 && + rm -f file1.rej file2.rej file2 && if git apply --reject patch.2 >rejects then @@ -79,18 +90,20 @@ test_expect_success 'apply with --reject should fail but update the file' ' exit 1 fi - cat rejects - - for i in 1 E 2 3 4 5 6 7 8 9 10 11 12 C 13 14 15 16 17 18 19 20 F 21 - do - echo $i - done >expected.file2 && - test -f file1 && { echo "file1 still exists?" exit 1 } - diff -u file2 expected.file2 + diff -u file2 expected && + + cat file2.rej && + + if test -f file1.rej + then + echo "file2 should not have been touched" + exit 1 + fi + ' test_done |