git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] stash: test show --include-untracked includes untracked files

From
Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Date
May 5, 2026, 10:33 UTC
Message-ID
<20260505103332.43702-2-pushkarkumarsingh1970@gmail.com>

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
Next: Pushkar Singh
Message 1 of 2 in “stash: test show --include-untracked includes untracked files”
  1. stash: test show --include-untracked includes untracked filesPushkar Singh, May 5, 2026
  2. stash: add coverage for show --include-untrackedPushkar Singh, May 16, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.