checkout: retire --ignore-other-worktrees in favor of --force
As a safeguard, checking out a branch already checked out by a different worktree is disallowed. This behavior can be overridden with --ignore-other-worktrees, however, this option is neither obvious nor particularly discoverable. As a common safeguard override, --force is more likely to come to mind. Therefore, overload it to also suppress the check for a branch already checked out elsewhere. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1eb07d829f
commit
0d1a151783
@ -303,7 +303,7 @@ static int add(int ac, const char **av, const char *prefix)
|
||||
|
||||
argv_array_push(&cmd, "checkout");
|
||||
if (force)
|
||||
argv_array_push(&cmd, "--ignore-other-worktrees");
|
||||
argv_array_push(&cmd, "--force");
|
||||
if (new_branch)
|
||||
argv_array_pushl(&cmd, "-b", new_branch, NULL);
|
||||
if (new_branch_force)
|
||||
|
||||
Reference in New Issue
Block a user