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
This commit is contained in:
Junio C Hamano 2018-05-08 15:59:24 +09:00
commit 90186fa057
2 changed files with 4 additions and 3 deletions

View file

@ -14,7 +14,7 @@ SYNOPSIS
'git worktree lock' [--reason <string>] <worktree>
'git worktree move' <worktree> <new-path>
'git worktree prune' [-n] [-v] [--expire <expire>]
'git worktree remove' [--force] <worktree>
'git worktree remove' [-f] <worktree>
'git worktree unlock' <worktree>
DESCRIPTION

View file

@ -783,8 +783,9 @@ static int remove_worktree(int ac, const char **av, const char *prefix)
{
int force = 0;
struct option options[] = {
OPT_BOOL(0, "force", &force,
N_("force removing even if the worktree is dirty")),
OPT__FORCE(&force,
N_("force removing even if the worktree is dirty"),
PARSE_OPT_NOCOMPLETE),
OPT_END()
};
struct worktree **worktrees, *wt;