summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-02-03 14:16:06 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-02-03 14:16:06 -0800
commitebcdd635c58e89dbf931a9f90a1b248fb5e90315 (patch)
tree3645a5388e860a75c11ffe6a10628440430163a8 /contrib/completion
parentMerge branch 'pw/completion-show-branch' (diff)
parentcompletion: update completion arguments for stash (diff)
downloadtgif-ebcdd635c58e89dbf931a9f90a1b248fb5e90315.tar.xz
Merge branch 'pw/completion-stash'
* pw/completion-stash: completion: update completion arguments for stash
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash17
1 files changed, 14 insertions, 3 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8e783eacf1..15ebba51dc 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2386,7 +2386,7 @@ _git_show_branch ()
_git_stash ()
{
- local save_opts='--keep-index --no-keep-index --quiet --patch'
+ local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
local subcommands='save list show apply clear drop pop create branch'
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
@@ -2408,9 +2408,20 @@ _git_stash ()
apply,--*|pop,--*)
__gitcomp "--index --quiet"
;;
- show,--*|drop,--*|branch,--*)
+ drop,--*)
+ __gitcomp "--quiet"
;;
- show,*|apply,*|drop,*|pop,*|branch,*)
+ show,--*|branch,--*)
+ ;;
+ branch,*)
+ if [ $cword -eq 3 ]; then
+ __gitcomp_nl "$(__git_refs)";
+ else
+ __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
+ | sed -n -e 's/:.*//p')"
+ fi
+ ;;
+ show,*|apply,*|drop,*|pop,*)
__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
| sed -n -e 's/:.*//p')"
;;