]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/checkout-B-branch-in-use'
authorJunio C Hamano <gitster@pobox.com>
Wed, 27 Dec 2023 22:52:24 +0000 (14:52 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Dec 2023 22:52:24 +0000 (14:52 -0800)
"git checkout -B <branch> [<start-point>]" allowed a branch that is
in use in another worktree to be updated and checked out, which
might be a bit unexpected.  The rule has been tightened, which is a
breaking change.  "--ignore-other-worktrees" option is required to
unbreak you, if you are used to the current behaviour that "-B"
overrides the safety.

* jc/checkout-B-branch-in-use:
  checkout: forbid "-B <branch>" from touching a branch used elsewhere
  checkout: refactor die_if_checked_out() caller

1  2 
builtin/checkout.c
t/t2400-worktree-add.sh

Simple merge
Simple merge