aboutsummaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorThomas Gummerer <t.gummerer@gmail.com>2017-02-28 20:33:40 +0000
committerJunio C Hamano <gitster@pobox.com>2017-02-28 14:21:10 -0800
commit9e140909f611fff720efc914b7186b8e4ab722cd (patch)
tree82d6ae0ad2a22e348cb3ceabb114fb066a7c32a4 /git-stash.sh
parent1ada5020b38c520f665259f6d9b3955672b92761 (diff)
downloadgit-9e140909f611fff720efc914b7186b8e4ab722cd.tar.gz
git-9e140909f611fff720efc914b7186b8e4ab722cd.tar.xz
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 <pathspec>. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 2b74d733b..9c70662cc 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