stash: add coverage for show --include-untracked
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>
Pushkar Singh committed
May 16, 2026 at 18:33 UTC
499f9048e0ef09285fe112dc387324404fb99b1d
1 file changed
+17
t/t3903-stash.sh
+17
@@ -1790,4 +1790,21 @@ test_expect_success 'stash.index=false overridden by --index' '
1790
test_cmp expect file
1791
'
1792
1793
+test_expect_success 'stash show --include-untracked includes untracked files' '
1794
+ git reset --hard &&
1795
+
1796
+ echo tracked >tracked &&
1797
+ git add tracked &&
1798
+ git commit -m "base" &&
1799
+
1800
+ echo change >>tracked &&
1801
+ echo untracked >untracked &&
1802
+
1803
+ git stash push --include-untracked &&
1804
+ test_path_is_missing untracked &&
1805
+
1806
+ git stash show --include-untracked >actual &&
1807
+ test_grep "untracked" actual
1808
+'
1809
+
1810
test_done