@@ -31,32 +31,32 @@ type RemoteSuite struct {
3131var _ = Suite (& RemoteSuite {})
3232
3333func (s * RemoteSuite ) TestFetchInvalidEndpoint (c * C ) {
34- r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"http://\\ " }})
34+ r := NewRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"http://\\ " }})
3535 err := r .Fetch (& FetchOptions {RemoteName : "foo" })
3636 c .Assert (err , ErrorMatches , ".*invalid character.*" )
3737}
3838
3939func (s * RemoteSuite ) TestFetchNonExistentEndpoint (c * C ) {
40- r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"ssh://non-existent/foo.git" }})
40+ r := NewRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"ssh://non-existent/foo.git" }})
4141 err := r .Fetch (& FetchOptions {})
4242 c .Assert (err , NotNil )
4343}
4444
4545func (s * RemoteSuite ) TestFetchInvalidSchemaEndpoint (c * C ) {
46- r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"qux://foo" }})
46+ r := NewRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"qux://foo" }})
4747 err := r .Fetch (& FetchOptions {})
4848 c .Assert (err , ErrorMatches , ".*unsupported scheme.*" )
4949}
5050
5151func (s * RemoteSuite ) TestFetchInvalidFetchOptions (c * C ) {
52- r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"qux://foo" }})
52+ r := NewRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"qux://foo" }})
5353 invalid := config .RefSpec ("^*$ñ" )
5454 err := r .Fetch (& FetchOptions {RefSpecs : []config.RefSpec {invalid }})
5555 c .Assert (err , Equals , config .ErrRefSpecMalformedSeparator )
5656}
5757
5858func (s * RemoteSuite ) TestFetchWildcard (c * C ) {
59- r := newRemote (memory .NewStorage (), & config.RemoteConfig {
59+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {
6060 URLs : []string {s .GetBasicLocalRepositoryURL ()},
6161 })
6262
@@ -72,7 +72,7 @@ func (s *RemoteSuite) TestFetchWildcard(c *C) {
7272}
7373
7474func (s * RemoteSuite ) TestFetchWildcardTags (c * C ) {
75- r := newRemote (memory .NewStorage (), & config.RemoteConfig {
75+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {
7676 URLs : []string {s .GetLocalRepositoryURL (fixtures .ByTag ("tags" ).One ())},
7777 })
7878
@@ -91,7 +91,7 @@ func (s *RemoteSuite) TestFetchWildcardTags(c *C) {
9191}
9292
9393func (s * RemoteSuite ) TestFetch (c * C ) {
94- r := newRemote (memory .NewStorage (), & config.RemoteConfig {
94+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {
9595 URLs : []string {s .GetLocalRepositoryURL (fixtures .ByTag ("tags" ).One ())},
9696 })
9797
@@ -105,7 +105,7 @@ func (s *RemoteSuite) TestFetch(c *C) {
105105}
106106
107107func (s * RemoteSuite ) TestFetchNonExistantReference (c * C ) {
108- r := newRemote (memory .NewStorage (), & config.RemoteConfig {
108+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {
109109 URLs : []string {s .GetLocalRepositoryURL (fixtures .ByTag ("tags" ).One ())},
110110 })
111111
@@ -119,7 +119,7 @@ func (s *RemoteSuite) TestFetchNonExistantReference(c *C) {
119119}
120120
121121func (s * RemoteSuite ) TestFetchContext (c * C ) {
122- r := newRemote (memory .NewStorage (), & config.RemoteConfig {
122+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {
123123 URLs : []string {s .GetLocalRepositoryURL (fixtures .ByTag ("tags" ).One ())},
124124 })
125125
@@ -135,7 +135,7 @@ func (s *RemoteSuite) TestFetchContext(c *C) {
135135}
136136
137137func (s * RemoteSuite ) TestFetchWithAllTags (c * C ) {
138- r := newRemote (memory .NewStorage (), & config.RemoteConfig {
138+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {
139139 URLs : []string {s .GetLocalRepositoryURL (fixtures .ByTag ("tags" ).One ())},
140140 })
141141
@@ -155,7 +155,7 @@ func (s *RemoteSuite) TestFetchWithAllTags(c *C) {
155155}
156156
157157func (s * RemoteSuite ) TestFetchWithNoTags (c * C ) {
158- r := newRemote (memory .NewStorage (), & config.RemoteConfig {
158+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {
159159 URLs : []string {s .GetLocalRepositoryURL (fixtures .ByTag ("tags" ).One ())},
160160 })
161161
@@ -171,7 +171,7 @@ func (s *RemoteSuite) TestFetchWithNoTags(c *C) {
171171}
172172
173173func (s * RemoteSuite ) TestFetchWithDepth (c * C ) {
174- r := newRemote (memory .NewStorage (), & config.RemoteConfig {
174+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {
175175 URLs : []string {s .GetBasicLocalRepositoryURL ()},
176176 })
177177
@@ -212,7 +212,7 @@ func (s *RemoteSuite) TestFetchWithProgress(c *C) {
212212 sto := memory .NewStorage ()
213213 buf := bytes .NewBuffer (nil )
214214
215- r := newRemote (sto , & config.RemoteConfig {Name : "foo" , URLs : []string {url }})
215+ r := NewRemote (sto , & config.RemoteConfig {Name : "foo" , URLs : []string {url }})
216216
217217 refspec := config .RefSpec ("+refs/heads/*:refs/remotes/origin/*" )
218218 err := r .Fetch (& FetchOptions {
@@ -248,7 +248,7 @@ func (s *RemoteSuite) TestFetchWithPackfileWriter(c *C) {
248248 mock := & mockPackfileWriter {Storer : fss }
249249
250250 url := s .GetBasicLocalRepositoryURL ()
251- r := newRemote (mock , & config.RemoteConfig {Name : "foo" , URLs : []string {url }})
251+ r := NewRemote (mock , & config.RemoteConfig {Name : "foo" , URLs : []string {url }})
252252
253253 refspec := config .RefSpec ("+refs/heads/*:refs/remotes/origin/*" )
254254 err = r .Fetch (& FetchOptions {
@@ -276,7 +276,7 @@ func (s *RemoteSuite) TestFetchNoErrAlreadyUpToDate(c *C) {
276276}
277277
278278func (s * RemoteSuite ) TestFetchNoErrAlreadyUpToDateButStillUpdateLocalRemoteRefs (c * C ) {
279- r := newRemote (memory .NewStorage (), & config.RemoteConfig {
279+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {
280280 URLs : []string {s .GetBasicLocalRepositoryURL ()},
281281 })
282282
@@ -313,7 +313,7 @@ func (s *RemoteSuite) TestFetchNoErrAlreadyUpToDateWithNonCommitObjects(c *C) {
313313}
314314
315315func (s * RemoteSuite ) doTestFetchNoErrAlreadyUpToDate (c * C , url string ) {
316- r := newRemote (memory .NewStorage (), & config.RemoteConfig {URLs : []string {url }})
316+ r := NewRemote (memory .NewStorage (), & config.RemoteConfig {URLs : []string {url }})
317317
318318 o := & FetchOptions {
319319 RefSpecs : []config.RefSpec {
@@ -328,7 +328,7 @@ func (s *RemoteSuite) doTestFetchNoErrAlreadyUpToDate(c *C, url string) {
328328}
329329
330330func (s * RemoteSuite ) testFetchFastForward (c * C , sto storage.Storer ) {
331- r := newRemote (sto , & config.RemoteConfig {
331+ r := NewRemote (sto , & config.RemoteConfig {
332332 URLs : []string {s .GetBasicLocalRepositoryURL ()},
333333 })
334334
@@ -386,7 +386,7 @@ func (s *RemoteSuite) TestFetchFastForwardFS(c *C) {
386386}
387387
388388func (s * RemoteSuite ) TestString (c * C ) {
389- r := newRemote (nil , & config.RemoteConfig {
389+ r := NewRemote (nil , & config.RemoteConfig {
390390 Name : "foo" ,
391391 URLs : []string {"https://github.com/git-fixtures/basic.git" },
392392 })
@@ -405,7 +405,7 @@ func (s *RemoteSuite) TestPushToEmptyRepository(c *C) {
405405 srcFs := fixtures .Basic ().One ().DotGit ()
406406 sto := filesystem .NewStorage (srcFs , cache .NewObjectLRUDefault ())
407407
408- r := newRemote (sto , & config.RemoteConfig {
408+ r := NewRemote (sto , & config.RemoteConfig {
409409 Name : DefaultRemoteName ,
410410 URLs : []string {url },
411411 })
@@ -442,7 +442,7 @@ func (s *RemoteSuite) TestPushContext(c *C) {
442442 fs := fixtures .ByURL ("https://github.com/git-fixtures/tags.git" ).One ().DotGit ()
443443 sto := filesystem .NewStorage (fs , cache .NewObjectLRUDefault ())
444444
445- r := newRemote (sto , & config.RemoteConfig {
445+ r := NewRemote (sto , & config.RemoteConfig {
446446 Name : DefaultRemoteName ,
447447 URLs : []string {url },
448448 })
@@ -471,7 +471,7 @@ func (s *RemoteSuite) TestPushTags(c *C) {
471471 fs := fixtures .ByURL ("https://github.com/git-fixtures/tags.git" ).One ().DotGit ()
472472 sto := filesystem .NewStorage (fs , cache .NewObjectLRUDefault ())
473473
474- r := newRemote (sto , & config.RemoteConfig {
474+ r := NewRemote (sto , & config.RemoteConfig {
475475 Name : DefaultRemoteName ,
476476 URLs : []string {url },
477477 })
@@ -494,7 +494,7 @@ func (s *RemoteSuite) TestPushNoErrAlreadyUpToDate(c *C) {
494494 fs := fixtures .Basic ().One ().DotGit ()
495495 sto := filesystem .NewStorage (fs , cache .NewObjectLRUDefault ())
496496
497- r := newRemote (sto , & config.RemoteConfig {
497+ r := NewRemote (sto , & config.RemoteConfig {
498498 Name : DefaultRemoteName ,
499499 URLs : []string {fs .Root ()},
500500 })
@@ -564,7 +564,7 @@ func (s *RemoteSuite) TestPushForce(c *C) {
564564 dstSto := filesystem .NewStorage (dstFs , cache .NewObjectLRUDefault ())
565565
566566 url := dstFs .Root ()
567- r := newRemote (sto , & config.RemoteConfig {
567+ r := NewRemote (sto , & config.RemoteConfig {
568568 Name : DefaultRemoteName ,
569569 URLs : []string {url },
570570 })
@@ -654,32 +654,32 @@ func (s *RemoteSuite) TestPushNewReferenceAndDeleteInBatch(c *C) {
654654}
655655
656656func (s * RemoteSuite ) TestPushInvalidEndpoint (c * C ) {
657- r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"http://\\ " }})
657+ r := NewRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"http://\\ " }})
658658 err := r .Push (& PushOptions {RemoteName : "foo" })
659659 c .Assert (err , ErrorMatches , ".*invalid character.*" )
660660}
661661
662662func (s * RemoteSuite ) TestPushNonExistentEndpoint (c * C ) {
663- r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"ssh://non-existent/foo.git" }})
663+ r := NewRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"ssh://non-existent/foo.git" }})
664664 err := r .Push (& PushOptions {})
665665 c .Assert (err , NotNil )
666666}
667667
668668func (s * RemoteSuite ) TestPushInvalidSchemaEndpoint (c * C ) {
669- r := newRemote (nil , & config.RemoteConfig {Name : "origin" , URLs : []string {"qux://foo" }})
669+ r := NewRemote (nil , & config.RemoteConfig {Name : "origin" , URLs : []string {"qux://foo" }})
670670 err := r .Push (& PushOptions {})
671671 c .Assert (err , ErrorMatches , ".*unsupported scheme.*" )
672672}
673673
674674func (s * RemoteSuite ) TestPushInvalidFetchOptions (c * C ) {
675- r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"qux://foo" }})
675+ r := NewRemote (nil , & config.RemoteConfig {Name : "foo" , URLs : []string {"qux://foo" }})
676676 invalid := config .RefSpec ("^*$ñ" )
677677 err := r .Push (& PushOptions {RefSpecs : []config.RefSpec {invalid }})
678678 c .Assert (err , Equals , config .ErrRefSpecMalformedSeparator )
679679}
680680
681681func (s * RemoteSuite ) TestPushInvalidRefSpec (c * C ) {
682- r := newRemote (nil , & config.RemoteConfig {
682+ r := NewRemote (nil , & config.RemoteConfig {
683683 Name : DefaultRemoteName ,
684684 URLs : []string {"some-url" },
685685 })
@@ -692,7 +692,7 @@ func (s *RemoteSuite) TestPushInvalidRefSpec(c *C) {
692692}
693693
694694func (s * RemoteSuite ) TestPushWrongRemoteName (c * C ) {
695- r := newRemote (nil , & config.RemoteConfig {
695+ r := NewRemote (nil , & config.RemoteConfig {
696696 Name : DefaultRemoteName ,
697697 URLs : []string {"some-url" },
698698 })
@@ -729,7 +729,7 @@ func (s *RemoteSuite) TestGetHaves(c *C) {
729729
730730func (s * RemoteSuite ) TestList (c * C ) {
731731 repo := fixtures .Basic ().One ()
732- remote := newRemote (memory .NewStorage (), & config.RemoteConfig {
732+ remote := NewRemote (memory .NewStorage (), & config.RemoteConfig {
733733 Name : DefaultRemoteName ,
734734 URLs : []string {repo .URL },
735735 })
@@ -784,7 +784,7 @@ func (s *RemoteSuite) TestUpdateShallows(c *C) {
784784 {nil , hashes [0 :6 ]},
785785 }
786786
787- remote := newRemote (memory .NewStorage (), & config.RemoteConfig {
787+ remote := NewRemote (memory .NewStorage (), & config.RemoteConfig {
788788 Name : DefaultRemoteName ,
789789 })
790790
@@ -817,7 +817,7 @@ func (s *RemoteSuite) TestUseRefDeltas(c *C) {
817817 fs := fixtures .ByURL ("https://github.com/git-fixtures/tags.git" ).One ().DotGit ()
818818 sto := filesystem .NewStorage (fs , cache .NewObjectLRUDefault ())
819819
820- r := newRemote (sto , & config.RemoteConfig {
820+ r := NewRemote (sto , & config.RemoteConfig {
821821 Name : DefaultRemoteName ,
822822 URLs : []string {url },
823823 })
0 commit comments