Conversation
9d1db89 to
9b3c230
Compare
There was a problem hiding this comment.
Pull request overview
Adds missing test coverage for error paths and bare-repo handling in the open package, hardens the browser-launch commands against flag injection by inserting -- before the URL, eliminates a net/url import shadowing by renaming a local variable, and centralizes the git config --get-regexp invocation in the gitw package so that LoadProviders now picks up local repo configuration in addition to global.
Changes:
- New tests:
TestGetURLErrors,TestGetURLBareRepo,TestLoadProvidersLocal,TestConfigGetRegexp. open: insert--separator inopen/xdg-openinvocations and rename shadowingurlvariable toopenURL.gitw: newConfigGetRegexpwrapper consumed byopen.LoadProviders, droppingopen's direct dependency ongo-git-cmd-wrapper.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| open/provider.go | Replaces direct git config call with gitw.ConfigGetRegexp; drops dependency on go-git-cmd-wrapper. |
| open/provider_test.go | Adds TestLoadProvidersLocal covering local-config provider discovery. |
| open/open.go | Adds -- separator to open/xdg-open and renames url to openURL to fix shadowing. |
| open/open_test.go | Adds error-path and bare-repo coverage for GetURL. |
| gitw/gitw.go | Adds ConfigGetRegexp wrapper; imports config subpackage. |
| gitw/gitw_test.go | Adds TestConfigGetRegexp exercising local config retrieval. |
| AGENTS.md | Updates docs to reflect new wrapper, tests, and local-config precedence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add TestGetURLErrors (not-a-git-repo, local remote, unsupported provider) - Add TestGetURLBareRepo covering the AbsoluteGitDir bare-repo fallback - Add TestConfigGetRegexp and TestLoadProvidersLocal for new gitw behaviour - Rename url → openURL in GetURL to fix net/url import shadowing - Add -- before URL in open/xdg-open to prevent flag injection - LoadProviders reads local git config before falling back to global - Move git config I/O into gitw.ConfigGetRegexp; open package no longer imports go-git-cmd-wrapper directly
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.
imports go-git-cmd-wrapper directly