Skip to content

Commit b8139c8

Browse files
LemmingAvalanchegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 777489f commit b8139c8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Documentation/git-checkout.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ Note that this option uses the no overlay mode by default (see also
290290
`--overlay`), and currently doesn't support overlay mode.
291291

292292
--ignore-other-worktrees::
293-
`git checkout` refuses when the wanted ref is already checked
294-
out by another worktree. This option makes it check the ref
295-
out anyway. In other words, the ref can be held by more than one
296-
worktree.
293+
`git checkout` refuses when the wanted branch is already checked
294+
out or otherwise in use by another worktree. This option makes
295+
it check the branch out anyway. In other words, the branch can
296+
be in use by more than one worktree.
297297

298298
--overwrite-ignore::
299299
--no-overwrite-ignore::

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ static struct option *add_common_switch_branch_options(
17161716
N_("update ignored files (default)"),
17171717
PARSE_OPT_NOCOMPLETE),
17181718
OPT_BOOL(0, "ignore-other-worktrees", &opts->ignore_other_worktrees,
1719-
N_("do not check if another worktree is holding the given ref")),
1719+
N_("do not check if another worktree is using this branch")),
17201720
OPT_END()
17211721
};
17221722
struct option *newopts = parse_options_concat(prevopts, options);

0 commit comments

Comments
 (0)