diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-05-08 08:59:24 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-08 08:59:24 +0200 |
commit | 90186fa0579e4dcdde08a2d823d9b269578d5a70 (patch) | |
tree | a6ccdb04314c69aa552b008d1b8707f74f327b99 | |
parent | Merge branch 'ma/double-dashes-in-docs' (diff) | |
parent | worktree: accept -f as short for --force for removal (diff) | |
download | git-90186fa0579e4dcdde08a2d823d9b269578d5a70.tar.xz git-90186fa0579e4dcdde08a2d823d9b269578d5a70.zip |
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
-rw-r--r-- | Documentation/git-worktree.txt | 2 | ||||
-rw-r--r-- | builtin/worktree.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index 2755ca90e3..9920d9c06e 100644 --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@ -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 diff --git a/builtin/worktree.c b/builtin/worktree.c index 40a438ed6c..30647b30c5 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -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; |