Skip to content

Commit 6f5ccd4

Browse files
tgummerergitster
authored andcommitted
stash: add test for the create command line arguments
Currently there is no test showing the expected behaviour of git stash create's command line arguments. Add a test for that to show the current expected behaviour and to make sure future refactorings don't break those expectations. Signed-off-by: Thomas Gummerer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f5727e2 commit 6f5ccd4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

t/t3903-stash.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,4 +784,22 @@ test_expect_success 'push -m shows right message' '
784784
test_cmp expect actual
785785
'
786786

787+
test_expect_success 'create stores correct message' '
788+
>foo &&
789+
git add foo &&
790+
STASH_ID=$(git stash create "create test message") &&
791+
echo "On master: create test message" >expect &&
792+
git show --pretty=%s -s ${STASH_ID} >actual &&
793+
test_cmp expect actual
794+
'
795+
796+
test_expect_success 'create with multiple arguments for the message' '
797+
>foo &&
798+
git add foo &&
799+
STASH_ID=$(git stash create test untracked) &&
800+
echo "On master: test untracked" >expect &&
801+
git show --pretty=%s -s ${STASH_ID} >actual &&
802+
test_cmp expect actual
803+
'
804+
787805
test_done

0 commit comments

Comments
 (0)