]> git.ipfire.org Git - thirdparty/git.git/commitdiff
stash: add coverage for show --include-untracked
authorPushkar Singh <pushkarkumarsingh1970@gmail.com>
Sat, 16 May 2026 18:33:48 +0000 (18:33 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 17 May 2026 05:59:46 +0000 (14:59 +0900)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3903-stash.sh

index 70879941c22f8c4c0046c7af4765f693d1de525f..d4867536b98271f326be292f41d47c1403d49f56 100755 (executable)
@@ -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