diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-07-01 19:40:50 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-07-01 19:40:50 -0700 |
commit | e6c7c2cc9766434607b8da5db872e7881a043925 (patch) | |
tree | ab967dcf2cedf2f9f63d54e12adc1ca046e4edc2 /t | |
parent | Merge branch 'ne/maint-1.6.0-diff-tree-t-r-show-directory' (diff) | |
parent | stash: teach quiet option (diff) | |
download | tgif-e6c7c2cc9766434607b8da5db872e7881a043925.tar.xz |
Merge branch 'sb/quiet-porcelains'
* sb/quiet-porcelains:
stash: teach quiet option
am, rebase: teach quiet option
submodule, repack: migrate to git-sh-setup's say()
git-sh-setup: introduce say() for quiet options
am: suppress apply errors when using 3-way
t4150: test applying with a newline in subject
Diffstat (limited to 't')
-rwxr-xr-x | t/t3400-rebase.sh | 19 | ||||
-rwxr-xr-x | t/t3903-stash.sh | 23 | ||||
-rwxr-xr-x | t/t4150-am.sh | 26 |
3 files changed, 62 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/t3903-stash.sh b/t/t3903-stash.sh index 7484cbede6..7a3fb67957 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -177,4 +177,27 @@ test_expect_success 'stash branch' ' test 0 = $(git stash list | wc -l) ' +test_expect_success 'apply -q is quiet' ' + echo foo > file && + git stash && + git stash apply -q > output.out 2>&1 && + test ! -s output.out +' + +test_expect_success 'save -q is quiet' ' + git stash save --quiet > output.out 2>&1 && + test ! -s output.out +' + +test_expect_success 'pop -q is quiet' ' + git stash pop -q > output.out 2>&1 && + test ! -s output.out +' + +test_expect_success 'drop -q is quiet' ' + git stash && + git stash drop -q > output.out 2>&1 && + test ! -s output.out +' + test_done diff --git a/t/t4150-am.sh b/t/t4150-am.sh index d6ebbaebe2..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 && @@ -305,4 +316,19 @@ test_expect_success 'am into an unborn branch' ' test "z$result" = "z$(git rev-parse first^{tree})" ' +test_expect_success 'am newline in subject' ' + git checkout first && + test_tick && + sed -e "s/second/second \\\n foo/" patch1 > patchnl && + git am < patchnl > output.out 2>&1 && + 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 |