diff options
author | Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com> | 2019-02-26 00:16:24 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-03-07 01:41:40 +0100 |
commit | 1ac528c0b0c3f3e8a5faa75ea25f422fcbc2ba39 (patch) | |
tree | 2f3bc3c18d2482efd2bd5defc1e315cb78de29de /t/t3903-stash.sh | |
parent | stash: convert push to builtin (diff) | |
download | git-1ac528c0b0c3f3e8a5faa75ea25f422fcbc2ba39.tar.xz git-1ac528c0b0c3f3e8a5faa75ea25f422fcbc2ba39.zip |
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-x | t/t3903-stash.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index b66da42831..97cc71fbaf 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 && |