checkout: refer to other-worktree branch, not ref
We can only check out commits or branches, not refs in general. And the problem here is if another worktree is using the branch that we want to check out. Let’s be more direct and just talk about branches instead of refs. Also replace “be held” with “in use”. Further, “in use” is not restricted to a branch being checked out (e.g. the branch could be busy on a rebase), hence generalize to “or otherwise in use” in the option description. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
777489f9e0
commit
b8139c8f4e
@@ -290,10 +290,10 @@ Note that this option uses the no overlay mode by default (see also
|
|||||||
`--overlay`), and currently doesn't support overlay mode.
|
`--overlay`), and currently doesn't support overlay mode.
|
||||||
|
|
||||||
--ignore-other-worktrees::
|
--ignore-other-worktrees::
|
||||||
`git checkout` refuses when the wanted ref is already checked
|
`git checkout` refuses when the wanted branch is already checked
|
||||||
out by another worktree. This option makes it check the ref
|
out or otherwise in use by another worktree. This option makes
|
||||||
out anyway. In other words, the ref can be held by more than one
|
it check the branch out anyway. In other words, the branch can
|
||||||
worktree.
|
be in use by more than one worktree.
|
||||||
|
|
||||||
--overwrite-ignore::
|
--overwrite-ignore::
|
||||||
--no-overwrite-ignore::
|
--no-overwrite-ignore::
|
||||||
|
|||||||
@@ -1716,7 +1716,7 @@ static struct option *add_common_switch_branch_options(
|
|||||||
N_("update ignored files (default)"),
|
N_("update ignored files (default)"),
|
||||||
PARSE_OPT_NOCOMPLETE),
|
PARSE_OPT_NOCOMPLETE),
|
||||||
OPT_BOOL(0, "ignore-other-worktrees", &opts->ignore_other_worktrees,
|
OPT_BOOL(0, "ignore-other-worktrees", &opts->ignore_other_worktrees,
|
||||||
N_("do not check if another worktree is holding the given ref")),
|
N_("do not check if another worktree is using this branch")),
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
struct option *newopts = parse_options_concat(prevopts, options);
|
struct option *newopts = parse_options_concat(prevopts, options);
|
||||||
|
|||||||
Reference in New Issue
Block a user