summaryrefslogtreecommitdiff
path: root/t/t7064-wtstatus-pv2.sh
diff options
context:
space:
mode:
authorØystein Walle <oystwa@gmail.com>2021-10-21 22:25:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-22 00:24:30 (GMT)
commit2e59e78096313920df470b6645a4323e2d8c0c6f (patch)
treefece250587f1e64d4ffed326c7cbccf435ff2716 /t/t7064-wtstatus-pv2.sh
parent612942a1d201d33c2e952c89d58e5c6d26a028a2 (diff)
downloadgit-2e59e78096313920df470b6645a4323e2d8c0c6f.zip
git-2e59e78096313920df470b6645a4323e2d8c0c6f.tar.gz
git-2e59e78096313920df470b6645a4323e2d8c0c6f.tar.bz2
status: print stash info with --porcelain=v2 --show-stash
The v2 porcelain format is very convenient for obtaining a lot of information about the current state of the repo, but does not contain any info about the stash. git status already accepts --show-stash but it's silently ignored when --porcelain=v2 is given. Let's add a simple line to print the number of stash entries but in a format similar in style to the rest of the format. Signed-off-by: Øystein Walle <oystwa@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7064-wtstatus-pv2.sh')
-rwxr-xr-xt/t7064-wtstatus-pv2.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7064-wtstatus-pv2.sh b/t/t7064-wtstatus-pv2.sh
index eeb0534..47fc21d 100755
--- a/t/t7064-wtstatus-pv2.sh
+++ b/t/t7064-wtstatus-pv2.sh
@@ -113,6 +113,21 @@ test_expect_success 'after first commit, create unstaged changes' '
test_cmp expect actual
'
+test_expect_success 'after first commit, stash existing changes' '
+ cat >expect <<-EOF &&
+ # branch.oid $H0
+ # branch.head initial-branch
+ # stash 2
+ EOF
+
+ test_when_finished "git stash pop && git stash pop" &&
+
+ git stash -- file_x &&
+ git stash &&
+ git status --porcelain=v2 --branch --show-stash --untracked-files=no >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'after first commit but omit untracked files and branch' '
cat >expect <<-EOF &&
1 .M N... 100644 100644 100644 $OID_X $OID_X file_x