Skip to content

Conversation

@majiayu000
Copy link

Summary

This PR fixes #5112

Changes

  • Added filtering in ConfigCommands.Branches() to exclude branches with empty names
  • This prevents the issue where lazygit couldn't display branches or remotes when .git/config contains a [branch ""] section
  • The fix is minimal and defensive, simply filtering out empty branch names from the configuration

Testing

  • All existing unit tests pass
  • The fix handles the edge case without affecting normal branch operations

Generated with Claude Code

…onfig

When .git/config contains a [branch ""] section with an empty name,
lazygit was unable to display branches or remotes. This fix filters
out any branches with empty names when loading branch configuration,
preventing the issue.

The fix is minimal and focused on the specific issue: empty branch
names are now excluded from the returned branch map in the
ConfigCommands.Branches() method.

Signed-off-by: majiayu000 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot see branches or remotes when there is a branch with an empty name

1 participant