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>
Matthew Kraai committed
Feb 25, 2019 at 23:16 UTC
b6e531e6c67c144c3f5cf96cb8be47aad0fcfe36
1 file changed
+8
t/t3903-stash.sh
+8
@@ -287,6 +287,14 @@ test_expect_success 'stash an added file' '
287
test new = "$(cat file3)"
288
'
289
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
+
298
test_expect_success 'stash rm then recreate' '
299
git reset --hard &&
300
git rm file &&