1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-26 10:36:12 +02:00

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>
This commit is contained in:
Matthew Kraai 2019-02-25 23:16:11 +00:00 committed by Junio C Hamano
parent 6a0b88b24d
commit b6e531e6c6

View File

@ -287,6 +287,14 @@ test_expect_success 'stash an added file' '
test new = "$(cat file3)"
'
test_expect_success 'stash --intent-to-add file' '
git reset --hard &&
echo new >file4 &&
git add --intent-to-add file4 &&
test_when_finished "git rm -f file4" &&
test_must_fail git stash
'
test_expect_success 'stash rm then recreate' '
git reset --hard &&
git rm file &&