Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

config: multiple values in RemoteConfig (URLs and Fetch) #501

Merged
merged 3 commits into from
Aug 2, 2017
Merged

config: multiple values in RemoteConfig (URLs and Fetch) #501

merged 3 commits into from
Aug 2, 2017

Conversation

smola
Copy link
Collaborator

@smola smola commented Jul 24, 2017

@smola
Copy link
Collaborator Author

smola commented Jul 24, 2017

This will be useful in src-d/borges to store all endpoints for each repository. It will be required to implement push to multiple URLs (#500) at some point too.

@bzz
Copy link
Contributor

bzz commented Jul 25, 2017

Looks like rebase might be in order.

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]
Copy link
Contributor

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://\\"}})
Copy link
Contributor

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

smola added 3 commits August 1, 2017 13:01
* 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.
@mcuadros mcuadros merged commit 9befb51 into src-d:master Aug 2, 2017
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? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants