Skip to content

Commit fc3d4e0

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 80eb519 commit fc3d4e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

builtin/worktree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static int add(int ac, const char **av, const char *prefix)
367367
struct option options[] = {
368368
OPT__FORCE(&opts.force,
369369
N_("checkout <branch> even if already checked out in other worktree"),
370-
0),
370+
PARSE_OPT_NOCOMPLETE),
371371
OPT_STRING('b', NULL, &opts.new_branch, N_("branch"),
372372
N_("create a new branch")),
373373
OPT_STRING('B', NULL, &new_branch_force, N_("branch"),

contrib/completion/git-completion.bash

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,16 +3021,16 @@ _git_worktree ()
30213021
else
30223022
case "$subcommand,$cur" in
30233023
add,--*)
3024-
__gitcomp "--detach"
3024+
__gitcomp_builtin worktree_add
30253025
;;
30263026
list,--*)
3027-
__gitcomp "--porcelain"
3027+
__gitcomp_builtin worktree_list
30283028
;;
30293029
lock,--*)
3030-
__gitcomp "--reason"
3030+
__gitcomp_builtin worktree_lock
30313031
;;
30323032
prune,--*)
3033-
__gitcomp "--dry-run --expire --verbose"
3033+
__gitcomp_builtin worktree_prune
30343034
;;
30353035
*)
30363036
;;

0 commit comments

Comments
 (0)