Repository navigation
Conversation
git allows a remote section without a url (e.g. only a fetch refspec). getRemoteURL indexed URLs[0] unconditionally, so apko build --vcs (the default) panicked in such a repository. Return an error instead; ProbeVCSUrl already logs it and builds without a VCS URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: k4lleanka <257361691+k4lleanka@users.noreply.github.com>
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.
git allows a remote section without a url, for example when only
remote.origin.fetchis set.getRemoteURLindexedURLs[0]unconditionally, soapko build(with--vcs, the default) panicked withindex out of range [0] with length 0when run in such a repository.It now returns an error.
ProbeVCSUrlalready logs that at debug level and builds without a VCS URL.Tested:
nourlcase inTestGetRemoteURL: panics on main, passes with the fix.apko build --vcsin a repo whoseoriginhas only a fetch refspec: main panics ingetRemoteURL; with the fix it logsfailed to probe VCS URL: fetching remote URL: git remote "origin" has no urland the build completes.go test -race ./...on Linux andgolangci-lintv2.15.0: no failures.AI disclosure: I used Claude Code to help find this and write the fix and test. I reviewed and ran them myself.