@@ -321,6 +321,8 @@ stdout '"Reuse": true'
321
321
! stdout '"(Dir|Info|GoMod|Zip)"'
322
322
323
323
# reuse attempt with stale hash should reinvoke git, not report reuse
324
+ cp tagtestsv022.json tagtestsv022badhash.json
325
+ replace '57952' '56952XXX' tagtestsv022badhash.json
324
326
go mod download -reuse=tagtestsv022badhash.json -x -json vcs-test.golang.org/git/
[email protected]
325
327
stderr 'git fetch'
326
328
! stdout '"Reuse": true'
@@ -337,6 +339,8 @@ stdout '"GoMod"'
337
339
stdout '"Zip"'
338
340
339
341
# reuse with stale repo URL
342
+ cp tagtestsv022.json tagtestsv022badurl.json
343
+ replace 'git/tagtests\"' 'git/tagtestsXXX\"' tagtestsv022badurl.json
340
344
go mod download -reuse=tagtestsv022badurl.json -x -json vcs-test.golang.org/git/
[email protected]
341
345
! stdout '"Reuse": true'
342
346
stdout '"URL": "https://vcs-test.golang.org/git/tagtests"'
@@ -346,80 +350,22 @@ stdout '"GoMod"'
346
350
stdout '"Zip"'
347
351
348
352
# reuse with stale VCS
353
+ cp tagtestsv022.json tagtestsv022badvcs.json
354
+ replace '\"git\"' '\"gitXXX\"' tagtestsv022badvcs.json
349
355
go mod download -reuse=tagtestsv022badvcs.json -x -json vcs-test.golang.org/git/
[email protected]
350
356
! stdout '"Reuse": true'
351
357
stdout '"URL": "https://vcs-test.golang.org/git/tagtests"'
352
358
353
359
# reuse with stale Dir
360
+ cp tagtestsv022.json tagtestsv022baddir.json
361
+ replace '\t\t\"Ref\":' '\t\t\"Subdir\": \"subdir\",\n\t\t\"Ref\":' tagtestsv022baddir.json
354
362
go mod download -reuse=tagtestsv022baddir.json -x -json vcs-test.golang.org/git/
[email protected]
355
363
! stdout '"Reuse": true'
356
364
stdout '"URL": "https://vcs-test.golang.org/git/tagtests"'
357
365
358
366
# reuse with stale TagSum
367
+ cp tagtests.json tagtestsbadtagsum.json
368
+ replace 'sMEOGo=' 'sMEoGo=XXX' tagtestsbadtagsum.json
359
369
go mod download -reuse=tagtestsbadtagsum.json -x -json vcs-test.golang.org/git/tagtests.git@latest
360
370
! stdout '"Reuse": true'
361
371
stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'
362
-
363
- -- tagtestsv022badhash.json --
364
- {
365
- "Path": "vcs-test.golang.org/git/tagtests.git",
366
- "Version": "v0.2.2",
367
- "Origin": {
368
- "VCS": "git",
369
- "URL": "https://vcs-test.golang.org/git/tagtests",
370
- "Ref": "refs/tags/v0.2.2",
371
- "Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952XXX"
372
- }
373
- }
374
-
375
- -- tagtestsbadtagsum.json --
376
- {
377
- "Path": "vcs-test.golang.org/git/tagtests.git",
378
- "Version": "v0.2.2",
379
- "Query": "latest",
380
- "Origin": {
381
- "VCS": "git",
382
- "URL": "https://vcs-test.golang.org/git/tagtests",
383
- "TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo=XXX",
384
- "Ref": "refs/tags/v0.2.2",
385
- "Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"
386
- },
387
- "Reuse": true
388
- }
389
-
390
- -- tagtestsv022badvcs.json --
391
- {
392
- "Path": "vcs-test.golang.org/git/tagtests.git",
393
- "Version": "v0.2.2",
394
- "Origin": {
395
- "VCS": "gitXXX",
396
- "URL": "https://vcs-test.golang.org/git/tagtests",
397
- "Ref": "refs/tags/v0.2.2",
398
- "Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"
399
- }
400
- }
401
-
402
- -- tagtestsv022baddir.json --
403
- {
404
- "Path": "vcs-test.golang.org/git/tagtests.git",
405
- "Version": "v0.2.2",
406
- "Origin": {
407
- "VCS": "git",
408
- "URL": "https://vcs-test.golang.org/git/tagtests",
409
- "Subdir": "subdir",
410
- "Ref": "refs/tags/v0.2.2",
411
- "Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"
412
- }
413
- }
414
-
415
- -- tagtestsv022badurl.json --
416
- {
417
- "Path": "vcs-test.golang.org/git/tagtests.git",
418
- "Version": "v0.2.2",
419
- "Origin": {
420
- "VCS": "git",
421
- "URL": "https://vcs-test.golang.org/git/tagtestsXXX",
422
- "Ref": "refs/tags/v0.2.2",
423
- "Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"
424
- }
425
- }
0 commit comments