From b6e531e6c67c144c3f5cf96cb8be47aad0fcfe36 Mon Sep 17 00:00:00 2001 From: Matthew Kraai Date: Mon, 25 Feb 2019 23:16:11 +0000 Subject: [PATCH] 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 Signed-off-by: Johannes Schindelin Signed-off-by: Thomas Gummerer Signed-off-by: Junio C Hamano --- t/t3903-stash.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 2fd4f01358..78d50bcf1e 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -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 && -- 2.47.1