From: Junio C Hamano Date: Thu, 22 Mar 2018 21:34:20 +0000 (-0700) Subject: Merge branch 'tg/stash-untracked-with-pathspec-fix' into next X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/73c4bef74fe4213115e37c548897200e5d5fc3d8?hp=-c Merge branch 'tg/stash-untracked-with-pathspec-fix' into next "git stash push -u -- " gave an unnecessary and confusing error message when there was no tracked files that match the , which has been fixed. * tg/stash-untracked-with-pathspec-fix: stash: drop superfluos pathspec parameter --- 73c4bef74fe4213115e37c548897200e5d5fc3d8 diff --combined git-stash.sh index 5f1e14bdca,d31924aea3..94793c1a91 --- a/git-stash.sh +++ b/git-stash.sh @@@ -76,12 -76,6 +76,12 @@@ create_stash () shift stash_msg=${1?"BUG: create_stash () -m requires an argument"} ;; + -m*) + stash_msg=${1#-m} + ;; + --message=*) + stash_msg=${1#--message=} + ;; -u|--include-untracked) shift untracked=${1?"BUG: create_stash () -u requires an argument"} @@@ -199,12 -193,6 +199,12 @@@ store_stash () shift stash_msg="$1" ;; + -m*) + stash_msg=${1#-m} + ;; + --message=*) + stash_msg=${1#--message=} + ;; -q|--quiet) quiet=t ;; @@@ -263,12 -251,6 +263,12 @@@ push_stash () test -z ${1+x} && usage stash_msg=$1 ;; + -m*) + stash_msg=${1#-m} + ;; + --message=*) + stash_msg=${1#--message=} + ;; --help) show_help ;; @@@ -278,7 -260,18 +278,7 @@@ ;; -*) option="$1" - # TRANSLATORS: $option is an invalid option, like - # `--blah-blah'. The 7 spaces at the beginning of the - # second line correspond to "error: ". So you should line - # up the second line with however many characters the - # translation of "error: " takes in your language. E.g. in - # English this is: - # - # $ git stash save --blah-blah 2>&1 | head -n 2 - # error: unknown option for 'stash save': --blah-blah - # To provide a message, use git stash save -- '--blah-blah' - eval_gettextln "error: unknown option for 'stash save': \$option - To provide a message, use git stash save -- '\$option'" + eval_gettextln "error: unknown option for 'stash push': \$option" usage ;; *) @@@ -317,7 -310,7 +317,7 @@@ test "$untracked" = "all" && CLEAN_X_OPTION=-x || CLEAN_X_OPTION= if test -n "$untracked" && test $# = 0 then - git clean --force --quiet -d $CLEAN_X_OPTION -- "$@" + git clean --force --quiet -d $CLEAN_X_OPTION fi if test $# != 0