completion: simplify _git_notes

This also adds completion for 'git notes remove' and 'git notes edit'.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2018-03-07 08:05:02 +07:00 committed by Junio C Hamano
parent b475e442e8
commit 4ea2c974a0

View File

@ -1836,19 +1836,11 @@ _git_notes ()
add,--reedit-message=*|append,--reedit-message=*)
__git_complete_refs --cur="${cur#*=}"
;;
add,--*)
__gitcomp_builtin notes_add
;;
append,--*)
__gitcomp_builtin notes_append
;;
copy,--*)
__gitcomp_builtin notes_copy
;;
prune,--*)
__gitcomp_builtin notes_prune
*,--*)
__gitcomp_builtin notes_$subcommand
;;
prune,*)
# this command does not take a ref, do not complete it
;;
*)
case "$prev" in