Skip to content

Commit bfc1b34

Browse files
benknoblegitster
authored andcommitted
completion: add stash import, export
These newer commands lack completion; implement basic support for options and arguments. Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 67ad421 commit bfc1b34

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

contrib/completion/git-completion.bash

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,7 +3465,7 @@ _git_sparse_checkout ()
34653465

34663466
_git_stash ()
34673467
{
3468-
local subcommands='push list show apply clear drop pop create branch'
3468+
local subcommands='push list show apply clear drop pop create branch import export'
34693469
local subcommand="$(__git_find_on_cmdline "$subcommands save")"
34703470

34713471
if [ -z "$subcommand" ]; then
@@ -3491,6 +3491,9 @@ _git_stash ()
34913491
show,--*)
34923492
__gitcomp_builtin stash_show "$__git_diff_common_options"
34933493
;;
3494+
export,--*)
3495+
__gitcomp_builtin stash_export "--print --to-ref"
3496+
;;
34943497
*,--*)
34953498
__gitcomp_builtin "stash_$subcommand"
34963499
;;
@@ -3502,7 +3505,10 @@ _git_stash ()
35023505
| sed -n -e 's/:.*//p')"
35033506
fi
35043507
;;
3505-
show,*|apply,*|drop,*|pop,*)
3508+
import,*)
3509+
__git_complete_refs
3510+
;;
3511+
show,*|apply,*|drop,*|pop,*|export,*)
35063512
__gitcomp_nl "$(__git stash list \
35073513
| sed -n -e 's/:.*//p')"
35083514
;;

0 commit comments

Comments
 (0)