summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Stephen Boyd <bebarino@gmail.com>2009-06-16 15:33:01 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-06-18 11:54:48 -0700
commit0e987a12fc1d481d81ad9c56f4714efb08667213 (patch)
tree3558298ec717c32ddac1204e6c9f751ab0da4d38 /t
parentsubmodule, repack: migrate to git-sh-setup's say() (diff)
downloadtgif-0e987a12fc1d481d81ad9c56f4714efb08667213.tar.xz
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')
-rwxr-xr-xt/t3400-rebase.sh19
-rwxr-xr-xt/t4150-am.sh18
2 files changed, 31 insertions, 6 deletions
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 7f62bfb9dd..c5c29ccc4f 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -54,8 +54,8 @@ test_expect_success 'rebase against master' '
git rebase master'
test_expect_success 'rebase against master twice' '
- git rebase master 2>err &&
- grep "Current branch my-topic-branch is up to date" err
+ git rebase master >out &&
+ grep "Current branch my-topic-branch is up to date" out
'
test_expect_success 'rebase against master twice with --force' '
@@ -65,14 +65,14 @@ test_expect_success 'rebase against master twice with --force' '
test_expect_success 'rebase against master twice from another branch' '
git checkout my-topic-branch^ &&
- git rebase master my-topic-branch 2>err &&
- grep "Current branch my-topic-branch is up to date" err
+ git rebase master my-topic-branch >out &&
+ grep "Current branch my-topic-branch is up to date" out
'
test_expect_success 'rebase fast-forward to master' '
git checkout my-topic-branch^ &&
- git rebase my-topic-branch 2>err &&
- grep "Fast-forwarded HEAD to my-topic-branch" err
+ git rebase my-topic-branch >out &&
+ grep "Fast-forwarded HEAD to my-topic-branch" out
'
test_expect_success \
@@ -126,4 +126,11 @@ test_expect_success 'Show verbose error when HEAD could not be detached' '
grep "Untracked working tree file .B. would be overwritten" output.err
'
+test_expect_success 'rebase -q is quiet' '
+ rm B &&
+ git checkout -b quiet topic &&
+ git rebase -q master > output.out 2>&1 &&
+ test ! -s output.out
+'
+
test_done
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