completion: reflog subcommands and options

Make generic the completion for reflog subcommands and its options.

Note that we still need to special case the options for "show".

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Rubén Justo
2024-03-02 16:52:24 +01:00
committed by Junio C Hamano
parent 476a236e72
commit 1284f9cc11

View File

@ -2445,8 +2445,12 @@ _git_rebase ()
_git_reflog () _git_reflog ()
{ {
local subcommands="show delete expire" local subcommands subcommand
local subcommand="$(__git_find_subcommand "$subcommands" "show")"
__git_resolve_builtins "reflog"
subcommands="$___git_resolved_builtins"
subcommand="$(__git_find_subcommand "$subcommands" "show")"
case "$subcommand,$cur" in case "$subcommand,$cur" in
show,--*) show,--*)
@ -2455,6 +2459,10 @@ _git_reflog ()
" "
return return
;; ;;
$subcommand,--*)
__gitcomp_builtin "reflog_$subcommand"
return
;;
esac esac
__git_complete_refs __git_complete_refs