completion: use __gitcomp_builtin in _git_worktree

The new completable options for "worktree add" are: --checkout --guess-remote --lock --track 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 Feb 9, 2018 at 18:02 UTC fc3d4e0cbe65639509c765726fe01a16575e9ae8
2 files changed +5 -5
builtin/worktree.c
+1 -1
@@ -367,7 +367,7 @@ static int add(int ac, const char **av, const char *prefix)
367 struct option options[] = {
368 OPT__FORCE(&opts.force,
369 N_("checkout <branch> even if already checked out in other worktree"),
370 - 0),
370 + PARSE_OPT_NOCOMPLETE),
371 OPT_STRING('b', NULL, &opts.new_branch, N_("branch"),
372 N_("create a new branch")),
373 OPT_STRING('B', NULL, &new_branch_force, N_("branch"),
contrib/completion/git-completion.bash
+4 -4
@@ -3021,16 +3021,16 @@ _git_worktree ()
3021 else
3022 case "$subcommand,$cur" in
3023 add,--*)
3024 - __gitcomp "--detach"
3024 + __gitcomp_builtin worktree_add
3025 ;;
3026 list,--*)
3027 - __gitcomp "--porcelain"
3027 + __gitcomp_builtin worktree_list
3028 ;;
3029 lock,--*)
3030 - __gitcomp "--reason"
3030 + __gitcomp_builtin worktree_lock
3031 ;;
3032 prune,--*)
3033 - __gitcomp "--dry-run --expire --verbose"
3033 + __gitcomp_builtin worktree_prune
3034 ;;
3035 *)
3036 ;;