Skip to content

Commit 0a8748d

Browse files
committed
Merge branch 'pw/completion-stash' into maint
* pw/completion-stash: completion: update completion arguments for stash
2 parents 39abb2e + d7d4ca8 commit 0a8748d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

contrib/completion/git-completion.bash

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,7 @@ _git_show_branch ()
23852385

23862386
_git_stash ()
23872387
{
2388-
local save_opts='--keep-index --no-keep-index --quiet --patch'
2388+
local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
23892389
local subcommands='save list show apply clear drop pop create branch'
23902390
local subcommand="$(__git_find_on_cmdline "$subcommands")"
23912391
if [ -z "$subcommand" ]; then
@@ -2407,9 +2407,20 @@ _git_stash ()
24072407
apply,--*|pop,--*)
24082408
__gitcomp "--index --quiet"
24092409
;;
2410-
show,--*|drop,--*|branch,--*)
2410+
drop,--*)
2411+
__gitcomp "--quiet"
24112412
;;
2412-
show,*|apply,*|drop,*|pop,*|branch,*)
2413+
show,--*|branch,--*)
2414+
;;
2415+
branch,*)
2416+
if [ $cword -eq 3 ]; then
2417+
__gitcomp_nl "$(__git_refs)";
2418+
else
2419+
__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
2420+
| sed -n -e 's/:.*//p')"
2421+
fi
2422+
;;
2423+
show,*|apply,*|drop,*|pop,*)
24132424
__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
24142425
| sed -n -e 's/:.*//p')"
24152426
;;

0 commit comments

Comments
 (0)