aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-07-24 10:51:01 +0200
committerSantiago M. Mola <santi@mola.io>2017-08-01 13:01:54 +0200
commit9488c59834f6a2591910b7b360721cec2c16c548 (patch)
treefea051f6cf08a62aad12e32b2240aa837be22628 /repository_test.go
parent7b08a3005480a50f0f4290aff8f3702085d5e30d (diff)
downloadgo-git-9488c59834f6a2591910b7b360721cec2c16c548.tar.gz
config: multiple values in RemoteConfig (URLs and Fetch)
* 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.
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/repository_test.go b/repository_test.go
index 558149b..00ce120 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -181,7 +181,7 @@ func (s *RepositorySuite) TestCreateRemoteAndRemote(c *C) {
r, _ := Init(memory.NewStorage(), nil)
remote, err := r.CreateRemote(&config.RemoteConfig{
Name: "foo",
- URL: "http://foo/foo.git",
+ URLs: []string{"http://foo/foo.git"},
})
c.Assert(err, IsNil)
@@ -205,7 +205,7 @@ func (s *RepositorySuite) TestDeleteRemote(c *C) {
r, _ := Init(memory.NewStorage(), nil)
_, err := r.CreateRemote(&config.RemoteConfig{
Name: "foo",
- URL: "http://foo/foo.git",
+ URLs: []string{"http://foo/foo.git"},
})
c.Assert(err, IsNil)
@@ -426,7 +426,7 @@ func (s *RepositorySuite) TestFetch(c *C) {
r, _ := Init(memory.NewStorage(), nil)
_, err := r.CreateRemote(&config.RemoteConfig{
Name: DefaultRemoteName,
- URL: s.GetBasicLocalRepositoryURL(),
+ URLs: []string{s.GetBasicLocalRepositoryURL()},
})
c.Assert(err, IsNil)
c.Assert(r.Fetch(&FetchOptions{}), IsNil)
@@ -449,7 +449,7 @@ func (s *RepositorySuite) TestFetchContext(c *C) {
r, _ := Init(memory.NewStorage(), nil)
_, err := r.CreateRemote(&config.RemoteConfig{
Name: DefaultRemoteName,
- URL: s.GetBasicLocalRepositoryURL(),
+ URLs: []string{s.GetBasicLocalRepositoryURL()},
})
c.Assert(err, IsNil)
@@ -531,7 +531,7 @@ func (s *RepositorySuite) TestCloneConfig(c *C) {
c.Assert(cfg.Core.IsBare, Equals, true)
c.Assert(cfg.Remotes, HasLen, 1)
c.Assert(cfg.Remotes["origin"].Name, Equals, "origin")
- c.Assert(cfg.Remotes["origin"].URL, Not(Equals), "")
+ c.Assert(cfg.Remotes["origin"].URLs, HasLen, 1)
}
func (s *RepositorySuite) TestCloneSingleBranchAndNonHEAD(c *C) {
@@ -629,7 +629,7 @@ func (s *RepositorySuite) TestPush(c *C) {
_, err = s.Repository.CreateRemote(&config.RemoteConfig{
Name: "test",
- URL: url,
+ URLs: []string{url},
})
c.Assert(err, IsNil)
@@ -657,7 +657,7 @@ func (s *RepositorySuite) TestPushContext(c *C) {
_, err = s.Repository.CreateRemote(&config.RemoteConfig{
Name: "foo",
- URL: url,
+ URLs: []string{url},
})
c.Assert(err, IsNil)