Skip to content

Commit b6e531e

Browse files
kraaigitster
authored andcommitted
t3903: add test for --intent-to-add file
Add a test showing the 'git stash' behaviour with a file that has been added with 'git add --intent-to-add'. Stash fails to stash the file, so the purpose of this test is mainly to make sure git doesn't crash, but exits normally in this situation. This is in preparation for converting stash into a builtin. [tg: pulled the test out into a separate commit] Signed-off-by: Matthew Kraai <mkraai@its.jnj.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 6a0b88b commit b6e531e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t3903-stash.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,14 @@ test_expect_success 'stash an added file' '
287287
test new = "$(cat file3)"
288288
'
289289

290+
test_expect_success 'stash --intent-to-add file' '
291+
git reset --hard &&
292+
echo new >file4 &&
293+
git add --intent-to-add file4 &&
294+
test_when_finished "git rm -f file4" &&
295+
test_must_fail git stash
296+
'
297+
290298
test_expect_success 'stash rm then recreate' '
291299
git reset --hard &&
292300
git rm file &&

0 commit comments

Comments
 (0)