aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorRubén Justo <rjusto@gmail.com>2024-03-02 16:52:24 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-03 14:21:39 -0800
commit1284f9cc11be4b656492938f68befbe4c87d915f (patch)
tree6a92b9bd73d67759553b83b00d87c91a3cb5e881 /contrib
parent476a236e72d7ad0d2a5237faeaa439b1054e80a5 (diff)
downloadgit-1284f9cc11be4b656492938f68befbe4c87d915f.tar.gz
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>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index f9fbf1f703..c5c9e9de2d 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2445,8 +2445,12 @@ _git_rebase ()
_git_reflog ()
{
- local subcommands="show delete expire"
- local subcommand="$(__git_find_subcommand "$subcommands" "show")"
+ local subcommands subcommand
+
+ __git_resolve_builtins "reflog"
+
+ subcommands="$___git_resolved_builtins"
+ subcommand="$(__git_find_subcommand "$subcommands" "show")"
case "$subcommand,$cur" in
show,--*)
@@ -2455,6 +2459,10 @@ _git_reflog ()
"
return
;;
+ $subcommand,--*)
+ __gitcomp_builtin "reflog_$subcommand"
+ return
+ ;;
esac
__git_complete_refs