From 9e140909f611fff720efc914b7186b8e4ab722cd Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Tue, 28 Feb 2017 20:33:40 +0000 Subject: stash: allow pathspecs in the no verb form Now that stash_push is used in the no verb form of stash, allow specifying the command line for this form as well. Always use -- to disambiguate pathspecs from other non-option arguments. Also make git stash -p an alias for git stash push -p. This allows users to use git stash -p . Signed-off-by: Thomas Gummerer Signed-off-by: Junio C Hamano --- git-stash.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'git-stash.sh') diff --git a/git-stash.sh b/git-stash.sh index 2b74d733b1..9c70662cc8 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -656,12 +656,15 @@ apply_to_branch () { } } +test "$1" = "-p" && set "push" "$@" + PARSE_CACHE='--not-parsed' # The default command is "push" if nothing but options are given seen_non_option= for opt do case "$opt" in + --) break ;; -*) ;; *) seen_non_option=t; break ;; esac -- cgit v1.2.3