stash: add a test for stash create with no files
authorJoel Teichroeb <joel@teichroeb.net>
Sat, 19 Aug 2017 20:13:24 +0000 (13:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 19 Aug 2017 21:03:53 +0000 (14:03 -0700)
Ensure the command suceeds and outputs nothing

Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3903-stash.sh
index 4046817d70a0ac1dd5b11a49c500896688a4f0b1..f0708ced276381a7694553a8767d696201cf5149 100755 (executable)
@@ -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" &&