Fix panic when branch.autosetuprebase is set

It actually expect `branch.<name>.*`

`man git-config | rg "\s+branch\.\S+\$"` to show all possible keys.
This commit is contained in:
phanium 2026-03-31 09:55:07 +08:00
parent 050bffa580
commit 41cd78af48

View file

@ -93,7 +93,8 @@ func (self *ConfigCommands) Branches(cmd oscommands.ICmdObjBuilder) map[string]*
}
// key is like "branch.<name>.remote" or "branch.<name>.merge"
lastDot := strings.LastIndex(key, ".")
if lastDot < 0 {
// ignore key like branch.autosetuprebase
if lastDot < len("branch.") {
continue
}
configKey := key[lastDot+1:]