Merge branch 'tg/stash-untracked-with-pathspec-fix' into next
authorJunio C Hamano <gitster@pobox.com>
Thu, 22 Mar 2018 21:34:20 +0000 (14:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Mar 2018 21:34:20 +0000 (14:34 -0700)
"git stash push -u -- <pathspec>" gave an unnecessary and confusing
error message when there was no tracked files that match the
<pathspec>, which has been fixed.

* tg/stash-untracked-with-pathspec-fix:
stash: drop superfluos pathspec parameter

1  2 
git-stash.sh
diff --combined git-stash.sh
index 5f1e14bdca3cb9c95fea92f1f1db67c05b7e2f94,d31924aea3a03d6f7efc66c03a293406821f1af2..94793c1a913abf569ff9101d935c355b9eb27648
@@@ -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
                        ;;
                        ;;
                -*)
                        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
                        ;;
                *)
                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