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>

Rubén Justo committed Mar 2, 2024 at 16:52 UTC 1284f9cc11be4b656492938f68befbe4c87d915f
1 file changed +10 -2
contrib/completion/git-completion.bash
+10 -2
@@ -2445,8 +2445,12 @@ _git_rebase ()
2445
2446 _git_reflog ()
2447 {
2448 - local subcommands="show delete expire"
2449 - local subcommand="$(__git_find_subcommand "$subcommands" "show")"
2448 + local subcommands subcommand
2449 +
2450 + __git_resolve_builtins "reflog"
2451 +
2452 + subcommands="$___git_resolved_builtins"
2453 + subcommand="$(__git_find_subcommand "$subcommands" "show")"
2454
2455 case "$subcommand,$cur" in
2456 show,--*)
@@ -2455,6 +2459,10 @@ _git_reflog ()
2459 "
2460 return
2461 ;;
2462 + $subcommand,--*)
2463 + __gitcomp_builtin "reflog_$subcommand"
2464 + return
2465 + ;;
2466 esac
2467
2468 __git_complete_refs