public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH] stash: test show --include-untracked includes untracked files
@ 2026-05-05 10:33 Pushkar Singh
  2026-05-16 18:33 ` [PATCH v2] stash: add coverage for show --include-untracked Pushkar Singh
  0 siblings, 1 reply; 2+ messages in thread
From: Pushkar Singh @ 2026-05-05 10:33 UTC (permalink / raw)
  To: git; +Cc: gitster, peff, ps, Pushkar Singh

Add a test to verify that 'git stash show --include-untracked'
includes untracked files that were saved in the stash.

This ensures coverage for the third parent of stash commits,
which represents untracked files.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail•com>
---
 t/t3903-stash.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 70879941c2..d4867536b9 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -1790,4 +1790,21 @@ test_expect_success 'stash.index=false overridden by --index' '
 	test_cmp expect file
 '
 
+test_expect_success 'stash show --include-untracked includes untracked files' '
+	git reset --hard &&
+
+	echo tracked >tracked &&
+	git add tracked &&
+	git commit -m "base" &&
+
+	echo change >>tracked &&
+	echo untracked >untracked &&
+
+	git stash push --include-untracked &&
+	test_path_is_missing untracked &&
+
+	git stash show --include-untracked >actual &&
+	test_grep "untracked" actual
+'
+
 test_done
-- 
2.53.0.582.gca1db8a0f7


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2] stash: add coverage for show --include-untracked
  2026-05-05 10:33 [PATCH] stash: test show --include-untracked includes untracked files Pushkar Singh
@ 2026-05-16 18:33 ` Pushkar Singh
  0 siblings, 0 replies; 2+ messages in thread
From: Pushkar Singh @ 2026-05-16 18:33 UTC (permalink / raw)
  To: pushkarkumarsingh1970; +Cc: git, gitster, peff, ps

Add a test for 'git stash show --include-untracked' to
cover the case where untracked files saved in the stash
are included in the output.

While stash creation and restoration of untracked files
are already tested, there is currently no explicit test
covering the output behavior of 'stash show
--include-untracked'.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail•com>
---
Changes in v2:
  - Clarify in the commit message that the patch fills a gap
    in existing test coverage for 'stash show
    --include-untracked'

 t/t3903-stash.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 70879941c2..d4867536b9 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -1790,4 +1790,21 @@ test_expect_success 'stash.index=false overridden by --index' '
 	test_cmp expect file
 '
 
+test_expect_success 'stash show --include-untracked includes untracked files' '
+	git reset --hard &&
+
+	echo tracked >tracked &&
+	git add tracked &&
+	git commit -m "base" &&
+
+	echo change >>tracked &&
+	echo untracked >untracked &&
+
+	git stash push --include-untracked &&
+	test_path_is_missing untracked &&
+
+	git stash show --include-untracked >actual &&
+	test_grep "untracked" actual
+'
+
 test_done
-- 
2.53.0.582.gca1db8a0f7


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-16 18:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 10:33 [PATCH] stash: test show --include-untracked includes untracked files Pushkar Singh
2026-05-16 18:33 ` [PATCH v2] stash: add coverage for show --include-untracked Pushkar Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox