git branchless init --main-branch <branch>
does not set main branch if set in .git/config
#901
Labels
git branchless init --main-branch <branch>
does not set main branch if set in .git/config
#901
Description of the bug
This is a pretty obscure bug:
Command log
If a user set the main branch using
git config branchless.core.mainBranch <branch>
, then that branch gets deleted, git-branchless suggests runninggit branchless init --main-branch <branch>
to set it... but that updates the branch in.git/branchless/config
, which is then overridden by the branch set in.git/config
.Expected behavior
The
.git/config
entry below should be deleted upon runninggit branchless init --main-branch main
:Alternatively, the config entry should be updated with the new main branch name. This might be more reasonable as all other config options set in
.git/branchless/config
are typically never changed by the user (aliases, excludingrefs/branchless/*
from log, and removing the detached HEAD advice).Actual behavior
The
.git/config
entry wasn't deleted or updated, resulting in the same "missing main branch" error.Version of
rustc
No response
Automated bug report
No response
Version of
git-branchless
b66f76c (patched on top of f25babf)
Version of
git
git version 2.40.0.634.g4ca3ef3211-goog
The text was updated successfully, but these errors were encountered: