diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-02-05 14:54:16 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-05 14:54:16 -0800 |
commit | 0a8748d8e160f613b692f904161f19e120645e61 (patch) | |
tree | 4008ff10b9d75c86567ca0286e30d8a873f125fa /contrib | |
parent | Merge branch 'pw/completion-show-branch' into maint (diff) | |
parent | completion: update completion arguments for stash (diff) | |
download | tgif-0a8748d8e160f613b692f904161f19e120645e61.tar.xz |
Merge branch 'pw/completion-stash' into maint
* pw/completion-stash:
completion: update completion arguments for stash
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/completion/git-completion.bash | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 11bf827fc3..59a51fe344 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2385,7 +2385,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 @@ -2407,9 +2407,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')" ;; |