This repository was archived by the owner on Sep 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 534
config: multiple values in RemoteConfig (URLs and Fetch) #501
Merged
Conversation
This file contains 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
This will be useful in |
This was referenced Jul 24, 2017
ajnavarro
approved these changes
Jul 24, 2017
Looks like rebase might be in order. |
ajnavarro
suggested changes
Jul 25, 2017
remote.go
Outdated
@@ -42,8 +42,8 @@ func (r *Remote) Config() *config.RemoteConfig { | |||
} | |||
|
|||
func (r *Remote) String() string { | |||
fetch := r.c.URL | |||
push := r.c.URL | |||
fetch := r.c.URLs[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can throw panics
@@ -27,33 +27,33 @@ type RemoteSuite struct { | |||
var _ = Suite(&RemoteSuite{}) | |||
|
|||
func (s *RemoteSuite) TestFetchInvalidEndpoint(c *C) { | |||
r := newRemote(nil, &config.RemoteConfig{Name: "foo", URL: "http://\\"}) | |||
r := newRemote(nil, &config.RemoteConfig{Name: "foo", URLs: []string{"http://\\"}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test with a RemoteConfig with a nil slice of URLs. It will panic
ajnavarro
approved these changes
Jul 27, 2017
* Change `URL string` to `URL []string` in `RemoteConfig`, since git allows multiple URLs per remote. See: http://marc.info/?l=git&m=116231242118202&w=2 * Fix marshalling of multiple fetch refspecs.
This is more convenient for testing and debugging.
Do not change order of options (e.g. in RemoteConfig) when serializing for any option whose value has not changed.
smola
added a commit
to smola/borges
that referenced
this pull request
Aug 2, 2017
This version contains src-d/go-git#501 which is required to store multiple URLs per remote.
smola
added a commit
to smola/borges
that referenced
this pull request
Aug 2, 2017
This version contains src-d/go-git#501 which is required to store multiple URLs per remote.
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
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.
Change
URL string
toURL []string
inRemoteConfig
, sincegit allows multiple URLs per remote. See:
http://marc.info/?l=git&m=116231242118202&w=2
Fix marshalling of multiple fetch refspecs.