summaryrefslogtreecommitdiff
path: root/t/t7508-status.sh
diff options
context:
space:
mode:
authorLiam Beguin <liambeguin@gmail.com>2017-06-17 22:30:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-19 05:17:47 (GMT)
commitc1b5d0194b98bd3d0acc9cec7070808fbbe6a740 (patch)
tree05c81f1a33815352c41e1a0b17bdeb005913379e /t/t7508-status.sh
parente01db917d8e5c66f9f90bf8c44995cf47200273a (diff)
downloadgit-c1b5d0194b98bd3d0acc9cec7070808fbbe6a740.zip
git-c1b5d0194b98bd3d0acc9cec7070808fbbe6a740.tar.gz
git-c1b5d0194b98bd3d0acc9cec7070808fbbe6a740.tar.bz2
status: add optional stash count information
Introduce '--show-stash' and its configuration option 'status.showStash' to allow git-status to show information about currently stashed entries. Signed-off-by: Liam Beguin <liambeguin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7508-status.sh')
-rwxr-xr-xt/t7508-status.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 7942784..7121a55 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -1608,4 +1608,36 @@ test_expect_success 'git commit -m will commit a staged but ignored submodule' '
git config -f .gitmodules --remove-section submodule.subname
'
+test_expect_success 'show stash info with "--show-stash"' '
+ git reset --hard &&
+ git stash clear &&
+ echo 1 >file &&
+ git add file &&
+ git stash &&
+ git status >expected_default &&
+ git status --show-stash >expected_with_stash &&
+ test_i18ngrep "^Your stash currently has 1 entry$" expected_with_stash
+'
+
+test_expect_success 'no stash info with "--show-stash --no-show-stash"' '
+ git status --show-stash --no-show-stash >expected_without_stash &&
+ test_cmp expected_default expected_without_stash
+'
+
+test_expect_success '"status.showStash=false" weaker than "--show-stash"' '
+ git -c status.showStash=false status --show-stash >actual &&
+ test_cmp expected_with_stash actual
+'
+
+test_expect_success '"status.showStash=true" weaker than "--no-show-stash"' '
+ git -c status.showStash=true status --no-show-stash >actual &&
+ test_cmp expected_without_stash actual
+'
+
+test_expect_success 'no additionnal info if no stash entries' '
+ git stash clear &&
+ git -c status.showStash=true status >actual &&
+ test_cmp expected_without_stash actual
+'
+
test_done