summaryrefslogtreecommitdiff
path: root/t/t3903-stash.sh
diff options
context:
space:
mode:
authorPaul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>2019-02-25 23:16:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-07 00:41:40 (GMT)
commit1ac528c0b0c3f3e8a5faa75ea25f422fcbc2ba39 (patch)
tree2f3bc3c18d2482efd2bd5defc1e315cb78de29de /t/t3903-stash.sh
parentd553f538b8a788a4a285af2000edf3285694182e (diff)
downloadgit-1ac528c0b0c3f3e8a5faa75ea25f422fcbc2ba39.zip
git-1ac528c0b0c3f3e8a5faa75ea25f422fcbc2ba39.tar.gz
git-1ac528c0b0c3f3e8a5faa75ea25f422fcbc2ba39.tar.bz2
stash: make push -q quiet
There is a change in behaviour with this commit. When there was no initial commit, the shell version of stash would still display a message. This commit makes `push` to not display any message if `--quiet` or `-q` is specified. Add tests for `--quiet`. Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3903-stash.sh')
-rwxr-xr-xt/t3903-stash.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index b66da42..97cc71f 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -1072,6 +1072,29 @@ test_expect_success 'push: <pathspec> not in the repository errors out' '
test_path_is_file untracked
'
+test_expect_success 'push: -q is quiet with changes' '
+ >foo &&
+ git add foo &&
+ git stash push -q >output 2>&1 &&
+ test_must_be_empty output
+'
+
+test_expect_success 'push: -q is quiet with no changes' '
+ git stash push -q >output 2>&1 &&
+ test_must_be_empty output
+'
+
+test_expect_success 'push: -q is quiet even if there is no initial commit' '
+ git init foo_dir &&
+ test_when_finished rm -rf foo_dir &&
+ (
+ cd foo_dir &&
+ >bar &&
+ test_must_fail git stash push -q >output 2>&1 &&
+ test_must_be_empty output
+ )
+'
+
test_expect_success 'untracked files are left in place when -u is not given' '
>file &&
git add file &&