summaryrefslogtreecommitdiff
path: root/t/t4150-am.sh
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2009-06-16 15:33:01 -0700
committerJunio C Hamano <gitster@pobox.com>2009-06-18 11:54:48 -0700
commit0e987a12fc1d481d81ad9c56f4714efb08667213 (patch)
tree3558298ec717c32ddac1204e6c9f751ab0da4d38 /t/t4150-am.sh
parent2e6a30ef8fbaedc5f2ee199d36f7256bb0cfdf1e (diff)
downloadgit-0e987a12fc1d481d81ad9c56f4714efb08667213.tar.gz
am, rebase: teach quiet option
git-am and git-rebase are talkative scripts. Teach them to be quiet when told, allowing them to speak only when they fail or experience errors. The quiet option is maintained when git-am or git-rebase fails to apply a patch. This means subsequent --resolved, --continue, --skip, --abort invocations will be quiet if the original invocation was quiet. Drop a handful of >&2 redirection; the rest of the program sends all the info messages to stdout, not to stderr. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4150-am.sh')
-rwxr-xr-xt/t4150-am.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 51c369ad14..a12bf84623 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -180,6 +180,17 @@ test_expect_success 'am -3 falls back to 3-way merge' '
test -z "$(git diff lorem)"
'
+test_expect_success 'am -3 -q is quiet' '
+ git reset master2 --hard &&
+ sed -n -e "3,\$p" msg >file &&
+ head -n 9 msg >>file &&
+ git add file &&
+ test_tick &&
+ git commit -m "copied stuff" &&
+ git am -3 -q lorem-move.patch > output.out 2>&1 &&
+ ! test -s output.out
+'
+
test_expect_success 'am pauses on conflict' '
git checkout lorem2^^ &&
test_must_fail git am lorem-move.patch &&
@@ -313,4 +324,11 @@ test_expect_success 'am newline in subject' '
grep "^Applying: second \\\n foo$" output.out
'
+test_expect_success 'am -q is quiet' '
+ git checkout first &&
+ test_tick &&
+ git am -q < patch1 > output.out 2>&1 &&
+ ! test -s output.out
+'
+
test_done