From 41cd78af48bd6633d8c85255b90da06474f1b550 Mon Sep 17 00:00:00 2001 From: phanium <91544758+phanen@users.noreply.github.com> Date: Tue, 31 Mar 2026 09:55:07 +0800 Subject: [PATCH] Fix panic when branch.autosetuprebase is set It actually expect `branch..*` `man git-config | rg "\s+branch\.\S+\$"` to show all possible keys. --- pkg/commands/git_commands/config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/commands/git_commands/config.go b/pkg/commands/git_commands/config.go index ef463e3f6..a72fe504c 100644 --- a/pkg/commands/git_commands/config.go +++ b/pkg/commands/git_commands/config.go @@ -93,7 +93,8 @@ func (self *ConfigCommands) Branches(cmd oscommands.ICmdObjBuilder) map[string]* } // key is like "branch..remote" or "branch..merge" lastDot := strings.LastIndex(key, ".") - if lastDot < 0 { + // ignore key like branch.autosetuprebase + if lastDot < len("branch.") { continue } configKey := key[lastDot+1:]