stash: add a test for stash create with no files

Ensure the command suceeds and outputs nothing

Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Joel Teichroeb 2017-08-19 13:13:24 -07:00 committed by Junio C Hamano
parent b3622a4ee9
commit c95bc226d4

View file

@ -444,6 +444,14 @@ test_expect_failure 'stash file to directory' '
test foo = "$(cat file/file)"
'
test_expect_success 'stash create - no changes' '
git stash clear &&
test_when_finished "git reset --hard HEAD" &&
git reset --hard &&
git stash create >actual &&
test_must_be_empty actual
'
test_expect_success 'stash branch - no stashes on stack, stash-like argument' '
git stash clear &&
test_when_finished "git reset --hard HEAD" &&