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>

Joel Teichroeb committed Aug 19, 2017 at 13:13 UTC c95bc226d4ccc313303f700f11815c03fbec4efc
1 file changed +8
t/t3903-stash.sh
+8
@@ -444,6 +444,14 @@ test_expect_failure 'stash file to directory' '
444 test foo = "$(cat file/file)"
445 '
446
447 +test_expect_success 'stash create - no changes' '
448 + git stash clear &&
449 + test_when_finished "git reset --hard HEAD" &&
450 + git reset --hard &&
451 + git stash create >actual &&
452 + test_must_be_empty actual
453 +'
454 +
455 test_expect_success 'stash branch - no stashes on stack, stash-like argument' '
456 git stash clear &&
457 test_when_finished "git reset --hard HEAD" &&