summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-12-06 17:23:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-06 17:23:43 (GMT)
commit714485c7deb63e91b1ee7ba07be5f5a55fe03a39 (patch)
treed0d08d2e31f2287af477b48079338e10eb6d6f85 /t
parent79bafd23a82a883ab054c9fcaf1e3d3bea57e4b9 (diff)
parent5675473fcbd18fb320ca17cffc107506f09c7464 (diff)
downloadgit-714485c7deb63e91b1ee7ba07be5f5a55fe03a39.zip
git-714485c7deb63e91b1ee7ba07be5f5a55fe03a39.tar.gz
git-714485c7deb63e91b1ee7ba07be5f5a55fe03a39.tar.bz2
Merge branch 'ph/stash-save-m-option-fix'
In addition to "git stash -m message", the command learned to accept "git stash -mmessage" form. * ph/stash-save-m-option-fix: stash: learn to parse -m/--message like commit does
Diffstat (limited to 't')
-rwxr-xr-xt/t3903-stash.sh93
1 files changed, 93 insertions, 0 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 3b1ac19..39c7f2e 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -804,6 +804,99 @@ test_expect_success 'push -m shows right message' '
test_cmp expect actual
'
+test_expect_success 'push -m also works without space' '
+ >foo &&
+ git add foo &&
+ git stash push -m"unspaced test message" &&
+ echo "stash@{0}: On master: unspaced test message" >expect &&
+ git stash list -1 >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'store -m foo shows right message' '
+ git stash clear &&
+ git reset --hard &&
+ echo quux >bazzy &&
+ git add bazzy &&
+ STASH_ID=$(git stash create) &&
+ git stash store -m "store m" $STASH_ID &&
+ echo "stash@{0}: store m" >expect &&
+ git stash list -1 >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'store -mfoo shows right message' '
+ git stash clear &&
+ git reset --hard &&
+ echo quux >bazzy &&
+ git add bazzy &&
+ STASH_ID=$(git stash create) &&
+ git stash store -m"store mfoo" $STASH_ID &&
+ echo "stash@{0}: store mfoo" >expect &&
+ git stash list -1 >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'store --message=foo shows right message' '
+ git stash clear &&
+ git reset --hard &&
+ echo quux >bazzy &&
+ git add bazzy &&
+ STASH_ID=$(git stash create) &&
+ git stash store --message="store message=foo" $STASH_ID &&
+ echo "stash@{0}: store message=foo" >expect &&
+ git stash list -1 >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'store --message foo shows right message' '
+ git stash clear &&
+ git reset --hard &&
+ echo quux >bazzy &&
+ git add bazzy &&
+ STASH_ID=$(git stash create) &&
+ git stash store --message "store message foo" $STASH_ID &&
+ echo "stash@{0}: store message foo" >expect &&
+ git stash list -1 >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'push -mfoo uses right message' '
+ >foo &&
+ git add foo &&
+ git stash push -m"test mfoo" &&
+ echo "stash@{0}: On master: test mfoo" >expect &&
+ git stash list -1 >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'push --message foo is synonym for -mfoo' '
+ >foo &&
+ git add foo &&
+ git stash push --message "test message foo" &&
+ echo "stash@{0}: On master: test message foo" >expect &&
+ git stash list -1 >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'push --message=foo is synonym for -mfoo' '
+ >foo &&
+ git add foo &&
+ git stash push --message="test message=foo" &&
+ echo "stash@{0}: On master: test message=foo" >expect &&
+ git stash list -1 >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'push -m shows right message' '
+ >foo &&
+ git add foo &&
+ git stash push -m "test m foo" &&
+ echo "stash@{0}: On master: test m foo" >expect &&
+ git stash list -1 >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'create stores correct message' '
>foo &&
git add foo &&