]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/t3903-cover-stash-include-untracked' into next
authorJunio C Hamano <gitster@pobox.com>
Wed, 20 May 2026 01:32:35 +0000 (10:32 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 May 2026 01:32:35 +0000 (10:32 +0900)
Test coverage has been added to "git stash --include-untracked".

* ps/t3903-cover-stash-include-untracked:
  stash: add coverage for show --include-untracked

1  2 
t/t3903-stash.sh

index bdaad22e1fc47fb08372a59f239212fa3fef4e04,d4867536b98271f326be292f41d47c1403d49f56..ecc35aae82a5fe52b3f9cee195ff024b97940abb
@@@ -1791,27 -1790,21 +1791,44 @@@ test_expect_success 'stash.index=false 
        test_cmp expect file
  '
  
 +test_expect_success 'apply with custom conflict labels' '
 +      git reset --hard initial &&
 +      test_commit label-base conflict-file base-content &&
 +      echo stashed >conflict-file &&
 +      git stash push -m "stashed" &&
 +      test_commit label-upstream conflict-file upstream-content &&
 +      test_must_fail git -c merge.conflictStyle=diff3 stash apply --label-ours=UP --label-theirs=STASH &&
 +      test_grep "^<<<<<<< UP" conflict-file &&
 +      test_grep "^||||||| Stash base" conflict-file &&
 +      test_grep "^>>>>>>> STASH" conflict-file
 +'
 +
 +test_expect_success 'apply with empty conflict labels' '
 +      git reset --hard initial &&
 +      test_commit empty-label-base conflict-file base-content &&
 +      echo stashed >conflict-file &&
 +      git stash push -m "stashed" &&
 +      test_commit empty-label-upstream conflict-file upstream-content &&
 +      test_must_fail git stash apply --label-ours= --label-theirs= &&
 +      test_grep "^<<<<<<<$" conflict-file &&
 +      test_grep "^>>>>>>>$" conflict-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