Skip to content

Commit

Permalink
Merge branch 'pw/completion-stash'
Browse files Browse the repository at this point in the history
* pw/completion-stash:
  completion: update completion arguments for stash
  • Loading branch information
Junio C Hamano committed Feb 3, 2016
2 parents 47c33b4 + d7d4ca8 commit ebcdd63
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')"
;;
Expand Down

0 comments on commit ebcdd63

Please sign in to comment.