aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Kraai <mkraai@its.jnj.com>2019-02-25 23:16:11 +0000
committerJunio C Hamano <gitster@pobox.com>2019-03-07 09:41:40 +0900
commitb6e531e6c67c144c3f5cf96cb8be47aad0fcfe36 (patch)
tree008a7f903e660f9b90eafd44b8d355d295ef1fb5
parent6a0b88b24dc983dab6c8ca887cee3aec288947a7 (diff)
downloadgit-b6e531e6c67c144c3f5cf96cb8be47aad0fcfe36.tar.xz
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>
-rwxr-xr-xt/t3903-stash.sh8
1 files changed, 8 insertions, 0 deletions
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 &&