Repository navigation
Skip a remote with no URL when listing remotes [patch] - #208
Merged
Merged
Conversation
git remote -v lists a remote.<name>.* section that has no url as the name and a bare tab. The parser rejected that line, so a global remote.origin.prune=true made Remotes() throw in every repository without an origin. git treats such a remote as non-existent, so the parser now skips it. Fixes #175 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KLFPeLz9EhDwj3AmatpfG6
Contributor
Author
|
I don't think the hang comes from this PR. The other workflow's Generated by Claude Code |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #175
What was wrong
git remote -vlists aremote.<name>.*config section that has nourlasname<TAB>, with nothing after the tab. You get one from a globalremote.origin.prune=truein a repository without an origin.GitRemoteParserthrewGitParseExceptionon that line, soRemotes()failed for the whole repository and dropped the valid remotes along with it.Change
GitRemoteParser.Parsenow skips a line whose text after the tab is empty, which matches git treating such a remote as non-existent. Every other malformed line still throws."origin\t\nupstream\thttps://x (fetch)\nupstream\thttps://x (push)\n"returns onlyupstream.remote.ghost.prune=trueand no URL gets an empty list fromRemotes(), with no exception.Verification
dotnet testpassed 802 of 802.🤖 Generated with Claude Code
https://claude.ai/code/session_01KLFPeLz9EhDwj3AmatpfG6
Generated by Claude Code