Skip to content

Commit 90186fa

Browse files
committed
Merge branch 'sb/worktree-remove-opt-force'
"git worktree remove" learned that "-f" is a shorthand for "--force" option, just like for "git worktree add". * sb/worktree-remove-opt-force: worktree: accept -f as short for --force for removal
2 parents 535cfa3 + d228eea commit 90186fa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Documentation/git-worktree.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SYNOPSIS
1414
'git worktree lock' [--reason <string>] <worktree>
1515
'git worktree move' <worktree> <new-path>
1616
'git worktree prune' [-n] [-v] [--expire <expire>]
17-
'git worktree remove' [--force] <worktree>
17+
'git worktree remove' [-f] <worktree>
1818
'git worktree unlock' <worktree>
1919

2020
DESCRIPTION

builtin/worktree.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,9 @@ static int remove_worktree(int ac, const char **av, const char *prefix)
783783
{
784784
int force = 0;
785785
struct option options[] = {
786-
OPT_BOOL(0, "force", &force,
787-
N_("force removing even if the worktree is dirty")),
786+
OPT__FORCE(&force,
787+
N_("force removing even if the worktree is dirty"),
788+
PARSE_OPT_NOCOMPLETE),
788789
OPT_END()
789790
};
790791
struct worktree **worktrees, *wt;

0 commit comments

Comments
 (0)