From: D. Ben Knoble Date: Tue, 20 Oct 2026 13:06:54 GMT Subject: Re: switch/checkout stops halfway when it fails to write tracking config Message-ID: In-Reply-To: On Mon, Oct 19, 2026 at 9:41 PM 井上司 wrote: > > 5. Root cause > update_refs_for_switch() -> create_branch() -> setup_tracking() fails to write > the config, and the code calls exit(1) in setup_tracking() (branch.c). At that > point the worktree and the branch have been changed, but HEAD has not. This > exit was introduced in 27852b2c53 (branch: report errors in tracking branch > setup, 2016-02-22). I can see where create_branch() is called prior to setting up HEAD, but I'm mildly confused about the index/wt updates prior to either! It seems to me that should be one of the last steps, hm. Unfortunately, I'm having a hard time finding the responsible code outside of the "merge" case (which probably has a similar issue). -- D. Ben Knoble