@@ -7,7 +7,7 @@ env GOSUMDB=off
7
7
8
8
# go mod download with the pseudo-version should invoke git but not have a TagSum or Ref.
9
9
go mod download -x -json vcs-test.golang.org/git/
[email protected]
10
- stderr 'git fetch'
10
+ stderr 'git( .*)* fetch'
11
11
cp stdout hellopseudo.json
12
12
! stdout '"(Query|TagPrefix|TagSum|Ref)"'
13
13
stdout '"Version": "v0.0.0-20170922010558-fc3a09f3dc5c"'
@@ -18,7 +18,7 @@ go clean -modcache
18
18
19
19
# go mod download vcstest/hello should invoke git, print origin info
20
20
go mod download -x -json vcs-test.golang.org/git/hello.git@latest
21
- stderr 'git fetch'
21
+ stderr 'git( .*)* fetch'
22
22
cp stdout hello.json
23
23
stdout '"Version": "v0.0.0-20170922010558-fc3a09f3dc5c"'
24
24
stdout '"VCS": "git"'
@@ -33,13 +33,13 @@ stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
33
33
# but still be careful not to include a TagSum or a Ref, especially not Ref set to HEAD,
34
34
# which is easy to do when reusing the cached version from the @latest query.
35
35
go mod download -x -json vcs-test.golang.org/git/
[email protected]
36
- ! stderr 'git fetch'
36
+ ! stderr 'git( .*)* fetch'
37
37
cp stdout hellopseudo2.json
38
38
cmpenv hellopseudo.json hellopseudo2.json
39
39
40
40
# go mod download vcstest/hello@hash needs to check TagSum to find pseudoversion base.
41
41
go mod download -x -json vcs-test.golang.org/git/hello.git@fc3a09f3dc5c
42
- ! stderr 'git fetch'
42
+ ! stderr 'git( .*)* fetch'
43
43
cp stdout hellohash.json
44
44
stdout '"Version": "v0.0.0-20170922010558-fc3a09f3dc5c"'
45
45
stdout '"Query": "fc3a09f3dc5c"'
@@ -98,7 +98,7 @@ stdout '"RepoSum": "r1:c0/9JCZ25lxoBiK3[+]3BhACU4giH49flcJmBynJ[+]Jvmc="'
98
98
99
99
# go mod download vcstest/tagtests should invoke git, print origin info
100
100
go mod download -x -json vcs-test.golang.org/git/tagtests.git@latest
101
- stderr 'git fetch'
101
+ stderr 'git( .*)* fetch'
102
102
cp stdout tagtests.json
103
103
stdout '"Version": "v0.2.2"'
104
104
stdout '"Query": "latest"'
@@ -135,7 +135,7 @@ stdout '"Hash": "c7818c24fa2f3f714c67d0a6d3e411c85a518d1f"'
135
135
136
136
# go mod download vcstest/prefixtagtests should invoke git, print origin info
137
137
go mod download -x -json vcs-test.golang.org/git/prefixtagtests.git/sub@latest
138
- stderr 'git fetch'
138
+ stderr 'git( .*)* fetch'
139
139
cp stdout prefixtagtests.json
140
140
stdout '"Version": "v0.0.10"'
141
141
stdout '"Query": "latest"'
@@ -154,12 +154,12 @@ cp stdout all.json
154
154
# clean the module cache, make sure that makes go mod download re-run git fetch, clean again
155
155
go clean -modcache
156
156
go mod download -x -json vcs-test.golang.org/git/hello.git@latest
157
- stderr 'git fetch'
157
+ stderr 'git( .*)* fetch'
158
158
go clean -modcache
159
159
160
160
# reuse go mod download vcstest/hello result
161
161
go mod download -reuse=hello.json -x -json vcs-test.golang.org/git/hello.git@latest
162
- ! stderr 'git fetch'
162
+ ! stderr 'git( .*)* fetch'
163
163
stdout '"Reuse": true'
164
164
stdout '"Version": "v0.0.0-20170922010558-fc3a09f3dc5c"'
165
165
stdout '"VCS": "git"'
@@ -175,7 +175,7 @@ stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
175
175
176
176
# reuse go mod download vcstest/hello pseudoversion result
177
177
go mod download -reuse=hellopseudo.json -x -json vcs-test.golang.org/git/
[email protected]
178
- ! stderr 'git fetch'
178
+ ! stderr 'git( .*)* fetch'
179
179
stdout '"Reuse": true'
180
180
stdout '"Version": "v0.0.0-20170922010558-fc3a09f3dc5c"'
181
181
stdout '"VCS": "git"'
@@ -186,7 +186,7 @@ stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
186
186
187
187
# reuse go mod download vcstest/hello@hash
188
188
go mod download -reuse=hellohash.json -x -json vcs-test.golang.org/git/hello.git@fc3a09f3dc5c
189
- ! stderr 'git fetch'
189
+ ! stderr 'git( .*)* fetch'
190
190
stdout '"Reuse": true'
191
191
stdout '"Query": "fc3a09f3dc5c"'
192
192
stdout '"Version": "v0.0.0-20170922010558-fc3a09f3dc5c"'
@@ -199,7 +199,7 @@ stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
199
199
200
200
# reuse go mod download vcstest/hello/v9 error result
201
201
! go mod download -reuse=hellov9.json -x -json vcs-test.golang.org/git/hello.git/v9@latest
202
- ! stderr 'git fetch'
202
+ ! stderr 'git( .*)* fetch'
203
203
stdout '"Reuse": true'
204
204
stdout '"Error":.*no matching versions'
205
205
! stdout '"TagPrefix"'
@@ -210,7 +210,7 @@ stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
210
210
211
211
# reuse go mod download vcstest/hello/sub/v9 error result
212
212
! go mod download -reuse=hellosubv9.json -x -json vcs-test.golang.org/git/hello.git/sub/v9@latest
213
- ! stderr 'git fetch'
213
+ ! stderr 'git( .*)* fetch'
214
214
stdout '"Reuse": true'
215
215
stdout '"Error":.*no matching versions'
216
216
stdout '"TagPrefix": "sub/"'
@@ -221,7 +221,7 @@ stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
221
221
222
222
# reuse go mod download vcstest/hello@nonexist
223
223
! go mod download -reuse=hellononexist.json -x -json vcs-test.golang.org/git/hello.git@nonexist
224
- ! stderr 'git fetch'
224
+ ! stderr 'git( .*)* fetch'
225
225
stdout '"Reuse": true'
226
226
stdout '"Version": "nonexist"'
227
227
stdout '"Error":.*unknown revision nonexist'
@@ -231,7 +231,7 @@ stdout '"RepoSum": "r1:c0/9JCZ25lxoBiK3[+]3BhACU4giH49flcJmBynJ[+]Jvmc="'
231
231
232
232
# reuse go mod download vcstest/hello@1234567890123456789012345678901234567890
233
233
! go mod download -reuse=hellononhash.json -x -json vcs-test.golang.org/git/hello.git@1234567890123456789012345678901234567890
234
- ! stderr 'git fetch'
234
+ ! stderr 'git( .*)* fetch'
235
235
stdout '"Reuse": true'
236
236
stdout '"Version": "1234567890123456789012345678901234567890"'
237
237
stdout '"Error":.*unknown revision 1234567890123456789012345678901234567890'
@@ -241,7 +241,7 @@ stdout '"RepoSum": "r1:c0/9JCZ25lxoBiK3[+]3BhACU4giH49flcJmBynJ[+]Jvmc="'
241
241
242
242
# reuse go mod download vcstest/
[email protected]
243
243
! go mod download -reuse=hellononpseudo.json -x -json vcs-test.golang.org/git/
[email protected]
244
- ! stderr 'git fetch'
244
+ ! stderr 'git( .*)* fetch'
245
245
stdout '"Reuse": true'
246
246
stdout '"Version": "v0.0.0-20220101120101-123456789abc"'
247
247
stdout '"Error":.*unknown revision 123456789abc'
@@ -251,7 +251,7 @@ stdout '"RepoSum": "r1:c0/9JCZ25lxoBiK3[+]3BhACU4giH49flcJmBynJ[+]Jvmc="'
251
251
252
252
# reuse go mod download vcstest/tagtests result
253
253
go mod download -reuse=tagtests.json -x -json vcs-test.golang.org/git/tagtests.git@latest
254
- ! stderr 'git fetch'
254
+ ! stderr 'git( .*)* fetch'
255
255
stdout '"Reuse": true'
256
256
stdout '"Version": "v0.2.2"'
257
257
stdout '"Query": "latest"'
@@ -265,7 +265,7 @@ stdout '"Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"'
265
265
266
266
# reuse go mod download vcstest/
[email protected] result
267
267
go mod download -reuse=tagtestsv022.json -x -json vcs-test.golang.org/git/
[email protected]
268
- ! stderr 'git fetch'
268
+ ! stderr 'git( .*)* fetch'
269
269
stdout '"Reuse": true'
270
270
stdout '"Version": "v0.2.2"'
271
271
! stdout '"Query":'
@@ -279,7 +279,7 @@ stdout '"Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"'
279
279
280
280
# reuse go mod download vcstest/tagtests@master result
281
281
go mod download -reuse=tagtestsmaster.json -x -json vcs-test.golang.org/git/tagtests.git@master
282
- ! stderr 'git fetch'
282
+ ! stderr 'git( .*)* fetch'
283
283
stdout '"Reuse": true'
284
284
stdout '"Version": "v0.2.3-0.20190509225625-c7818c24fa2f"'
285
285
stdout '"Query": "master"'
@@ -293,7 +293,7 @@ stdout '"Hash": "c7818c24fa2f3f714c67d0a6d3e411c85a518d1f"'
293
293
294
294
# reuse go mod download vcstest/tagtests@master result again with all.json
295
295
go mod download -reuse=all.json -x -json vcs-test.golang.org/git/tagtests.git@master
296
- ! stderr 'git fetch'
296
+ ! stderr 'git( .*)* fetch'
297
297
stdout '"Reuse": true'
298
298
stdout '"Version": "v0.2.3-0.20190509225625-c7818c24fa2f"'
299
299
stdout '"Query": "master"'
@@ -307,7 +307,7 @@ stdout '"Hash": "c7818c24fa2f3f714c67d0a6d3e411c85a518d1f"'
307
307
308
308
# go mod download vcstest/prefixtagtests result with json
309
309
go mod download -reuse=prefixtagtests.json -x -json vcs-test.golang.org/git/prefixtagtests.git/sub@latest
310
- ! stderr 'git fetch'
310
+ ! stderr 'git( .*)* fetch'
311
311
stdout '"Version": "v0.0.10"'
312
312
stdout '"Query": "latest"'
313
313
stdout '"VCS": "git"'
@@ -321,15 +321,15 @@ stdout '"Hash": "2b7c4692e12c109263cab51b416fcc835ddd7eae"'
321
321
322
322
# reuse the bulk results with all.json
323
323
! go mod download -reuse=all.json -json vcs-test.golang.org/git/hello.git@latest vcs-test.golang.org/git/hello.git/v9@latest vcs-test.golang.org/git/hello.git/sub/v9@latest vcs-test.golang.org/git/tagtests.git@latest vcs-test.golang.org/git/
[email protected] vcs-test.golang.org/git/tagtests.git@master
324
- ! stderr 'git fetch'
324
+ ! stderr 'git( .*)* fetch'
325
325
stdout '"Reuse": true'
326
326
! stdout '"(Dir|Info|GoMod|Zip)"'
327
327
328
328
# reuse attempt with stale hash should reinvoke git, not report reuse
329
329
cp tagtestsv022.json tagtestsv022badhash.json
330
330
replace '57952' '56952XXX' tagtestsv022badhash.json
331
331
go mod download -reuse=tagtestsv022badhash.json -x -json vcs-test.golang.org/git/
[email protected]
332
- stderr 'git fetch'
332
+ stderr 'git( .*)* fetch'
333
333
! stdout '"Reuse": true'
334
334
stdout '"Version": "v0.2.2"'
335
335
! stdout '"Query"'
0 commit comments