@@ -26,25 +26,25 @@ type RemoteSuite struct {
26
26
var _ = Suite (& RemoteSuite {})
27
27
28
28
func (s * RemoteSuite ) TestFetchInvalidEndpoint (c * C ) {
29
- r := newRemote (nil , nil , & config.RemoteConfig {Name : "foo" , URL : "qux" })
29
+ r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URL : "qux" })
30
30
err := r .Fetch (& FetchOptions {})
31
31
c .Assert (err , ErrorMatches , ".*invalid endpoint.*" )
32
32
}
33
33
34
34
func (s * RemoteSuite ) TestFetchNonExistentEndpoint (c * C ) {
35
- r := newRemote (nil , nil , & config.RemoteConfig {Name : "foo" , URL : "ssh://non-existent/foo.git" })
35
+ r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URL : "ssh://non-existent/foo.git" })
36
36
err := r .Fetch (& FetchOptions {})
37
37
c .Assert (err , NotNil )
38
38
}
39
39
40
40
func (s * RemoteSuite ) TestFetchInvalidSchemaEndpoint (c * C ) {
41
- r := newRemote (nil , nil , & config.RemoteConfig {Name : "foo" , URL : "qux://foo" })
41
+ r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URL : "qux://foo" })
42
42
err := r .Fetch (& FetchOptions {})
43
43
c .Assert (err , ErrorMatches , ".*unsupported scheme.*" )
44
44
}
45
45
46
46
func (s * RemoteSuite ) TestFetchInvalidFetchOptions (c * C ) {
47
- r := newRemote (nil , nil , & config.RemoteConfig {Name : "foo" , URL : "qux://foo" })
47
+ r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URL : "qux://foo" })
48
48
invalid := config .RefSpec ("^*$ñ" )
49
49
err := r .Fetch (& FetchOptions {RefSpecs : []config.RefSpec {invalid }})
50
50
c .Assert (err , Equals , ErrInvalidRefSpec )
@@ -53,7 +53,7 @@ func (s *RemoteSuite) TestFetchInvalidFetchOptions(c *C) {
53
53
func (s * RemoteSuite ) TestFetch (c * C ) {
54
54
url := s .GetBasicLocalRepositoryURL ()
55
55
sto := memory .NewStorage ()
56
- r := newRemote (sto , nil , & config.RemoteConfig {Name : "foo" , URL : url })
56
+ r := newRemote (sto , & config.RemoteConfig {Name : "foo" , URL : url })
57
57
58
58
refspec := config .RefSpec ("+refs/heads/*:refs/remotes/origin/*" )
59
59
err := r .Fetch (& FetchOptions {
@@ -77,7 +77,7 @@ func (s *RemoteSuite) TestFetch(c *C) {
77
77
func (s * RemoteSuite ) TestFetchDepth (c * C ) {
78
78
url := s .GetBasicLocalRepositoryURL ()
79
79
sto := memory .NewStorage ()
80
- r := newRemote (sto , nil , & config.RemoteConfig {Name : "foo" , URL : url })
80
+ r := newRemote (sto , & config.RemoteConfig {Name : "foo" , URL : url })
81
81
82
82
refspec := config .RefSpec ("+refs/heads/*:refs/remotes/origin/*" )
83
83
err := r .Fetch (& FetchOptions {
@@ -112,11 +112,12 @@ func (s *RemoteSuite) TestFetchWithProgress(c *C) {
112
112
sto := memory .NewStorage ()
113
113
buf := bytes .NewBuffer (nil )
114
114
115
- r := newRemote (sto , buf , & config.RemoteConfig {Name : "foo" , URL : url })
115
+ r := newRemote (sto , & config.RemoteConfig {Name : "foo" , URL : url })
116
116
117
117
refspec := config .RefSpec ("+refs/heads/*:refs/remotes/origin/*" )
118
118
err := r .Fetch (& FetchOptions {
119
119
RefSpecs : []config.RefSpec {refspec },
120
+ Progress : buf ,
120
121
})
121
122
122
123
c .Assert (err , IsNil )
@@ -147,7 +148,7 @@ func (s *RemoteSuite) TestFetchWithPackfileWriter(c *C) {
147
148
mock := & mockPackfileWriter {Storer : fss }
148
149
149
150
url := s .GetBasicLocalRepositoryURL ()
150
- r := newRemote (mock , nil , & config.RemoteConfig {Name : "foo" , URL : url })
151
+ r := newRemote (mock , & config.RemoteConfig {Name : "foo" , URL : url })
151
152
152
153
refspec := config .RefSpec ("+refs/heads/*:refs/remotes/origin/*" )
153
154
err = r .Fetch (& FetchOptions {
@@ -183,7 +184,7 @@ func (s *RemoteSuite) TestFetchNoErrAlreadyUpToDateWithNonCommitObjects(c *C) {
183
184
func (s * RemoteSuite ) doTestFetchNoErrAlreadyUpToDate (c * C , url string ) {
184
185
185
186
sto := memory .NewStorage ()
186
- r := newRemote (sto , nil , & config.RemoteConfig {Name : "foo" , URL : url })
187
+ r := newRemote (sto , & config.RemoteConfig {Name : "foo" , URL : url })
187
188
188
189
refspec := config .RefSpec ("+refs/heads/*:refs/remotes/origin/*" )
189
190
o := & FetchOptions {
@@ -197,7 +198,7 @@ func (s *RemoteSuite) doTestFetchNoErrAlreadyUpToDate(c *C, url string) {
197
198
}
198
199
199
200
func (s * RemoteSuite ) TestString (c * C ) {
200
- r := newRemote (nil , nil , & config.RemoteConfig {
201
+ r := newRemote (nil , & config.RemoteConfig {
201
202
Name : "foo" ,
202
203
URL : "https://github.com/git-fixtures/basic.git" ,
203
204
})
@@ -216,7 +217,7 @@ func (s *RemoteSuite) TestPushToEmptyRepository(c *C) {
216
217
dstFs := fixtures .ByTag ("empty" ).One ().DotGit ()
217
218
url := fmt .Sprintf ("file://%s" , dstFs .Base ())
218
219
219
- r := newRemote (sto , nil , & config.RemoteConfig {
220
+ r := newRemote (sto , & config.RemoteConfig {
220
221
Name : DefaultRemoteName ,
221
222
URL : url ,
222
223
})
@@ -253,7 +254,7 @@ func (s *RemoteSuite) TestPushNoErrAlreadyUpToDate(c *C) {
253
254
sto , err := filesystem .NewStorage (f .DotGit ())
254
255
c .Assert (err , IsNil )
255
256
url := fmt .Sprintf ("file://%s" , f .DotGit ().Base ())
256
- r := newRemote (sto , nil , & config.RemoteConfig {
257
+ r := newRemote (sto , & config.RemoteConfig {
257
258
Name : DefaultRemoteName ,
258
259
URL : url ,
259
260
})
@@ -266,32 +267,32 @@ func (s *RemoteSuite) TestPushNoErrAlreadyUpToDate(c *C) {
266
267
}
267
268
268
269
func (s * RemoteSuite ) TestPushInvalidEndpoint (c * C ) {
269
- r := newRemote (nil , nil , & config.RemoteConfig {Name : "foo" , URL : "qux" })
270
+ r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URL : "qux" })
270
271
err := r .Push (& PushOptions {})
271
272
c .Assert (err , ErrorMatches , ".*invalid endpoint.*" )
272
273
}
273
274
274
275
func (s * RemoteSuite ) TestPushNonExistentEndpoint (c * C ) {
275
- r := newRemote (nil , nil , & config.RemoteConfig {Name : "foo" , URL : "ssh://non-existent/foo.git" })
276
+ r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URL : "ssh://non-existent/foo.git" })
276
277
err := r .Push (& PushOptions {})
277
278
c .Assert (err , NotNil )
278
279
}
279
280
280
281
func (s * RemoteSuite ) TestPushInvalidSchemaEndpoint (c * C ) {
281
- r := newRemote (nil , nil , & config.RemoteConfig {Name : "foo" , URL : "qux://foo" })
282
+ r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URL : "qux://foo" })
282
283
err := r .Push (& PushOptions {})
283
284
c .Assert (err , ErrorMatches , ".*unsupported scheme.*" )
284
285
}
285
286
286
287
func (s * RemoteSuite ) TestPushInvalidFetchOptions (c * C ) {
287
- r := newRemote (nil , nil , & config.RemoteConfig {Name : "foo" , URL : "qux://foo" })
288
+ r := newRemote (nil , & config.RemoteConfig {Name : "foo" , URL : "qux://foo" })
288
289
invalid := config .RefSpec ("^*$ñ" )
289
290
err := r .Push (& PushOptions {RefSpecs : []config.RefSpec {invalid }})
290
291
c .Assert (err , Equals , ErrInvalidRefSpec )
291
292
}
292
293
293
294
func (s * RemoteSuite ) TestPushInvalidRefSpec (c * C ) {
294
- r := newRemote (nil , nil , & config.RemoteConfig {
295
+ r := newRemote (nil , & config.RemoteConfig {
295
296
Name : DefaultRemoteName ,
296
297
URL : "file:///some-url" ,
297
298
})
@@ -304,7 +305,7 @@ func (s *RemoteSuite) TestPushInvalidRefSpec(c *C) {
304
305
}
305
306
306
307
func (s * RemoteSuite ) TestPushWrongRemoteName (c * C ) {
307
- r := newRemote (nil , nil , & config.RemoteConfig {
308
+ r := newRemote (nil , & config.RemoteConfig {
308
309
Name : DefaultRemoteName ,
309
310
URL : "file:///some-url" ,
310
311
})
0 commit comments