Skip to content

Commit 8ef273d

Browse files
kraaidscho
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 <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Thomas Gummerer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f198a70 commit 8ef273d

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)