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>
Nguyễn Thái Ngọc Duy committed
Mar 7, 2018 at 08:05 UTC
4ea2c974a0ffef18b966be1bb03168c7f10799c1
1 file changed
+3
-11
contrib/completion/git-completion.bash
+3
-11
@@ -1836,19 +1836,11 @@ _git_notes ()
1836
add,--reedit-message=*|append,--reedit-message=*)
1837
__git_complete_refs --cur="${cur#*=}"
1838
;;
1839
- add,--*)
1840
- __gitcomp_builtin notes_add
1841
- ;;
1842
- append,--*)
1843
- __gitcomp_builtin notes_append
1844
- ;;
1845
- copy,--*)
1846
- __gitcomp_builtin notes_copy
1847
- ;;
1848
- prune,--*)
1849
- __gitcomp_builtin notes_prune
1839
+ *,--*)
1840
+ __gitcomp_builtin notes_$subcommand
1841
;;
1842
prune,*)
1843
+ # this command does not take a ref, do not complete it
1844
;;
1845
*)
1846
case "$prev" in