On Mon, Feb 17, 2020 at 5:19 AM Junio C Hamano <gitster@xxxxxxxxx> wrote: > What I suggested was somewhat different, though. > > 1) get_main_worktree() fix you have as [1/3] in the current round. > > 2) fix `.denyCurrentBranch` for unborn branches in the primary > worktree, new tests for the cases I outlined in the message you > are responding to, and adjusting the test (i.e. what you have > as [2/3] in the current round). > > 3) fix `.denyCurrentBranch` to pay attention to HEAD of not just > the primary worktree but of all the worktrees, and add tests. I doubt that it's possible to solve these 2 issues separately. As dscho said: "a fix for one bug would be a fix for the other, and (probably) vice versa." As I discussed with dscho, the best possible solution for this situation is to demonstrate the bug and fix it in succeeding commit. I have sent this v2[1] for this patch. Thanks, Hariom [1]: https://lore.kernel.org/git/pull.535.v2.git.1582410908.gitgitgadget@xxxxxxxxx/