Skip to content

Commit 9b9b3d8

Browse files
author
Bryan C. Mills
committed
zip: always populate known keys in haveVCS map in TestVCS
This fixes TestVCS after CL 375915 on longtest builders that lack 'git' binaries. Change-Id: Ifb8a547e411c8e0ac6736e8a439107df87f41c91 Reviewed-on: https://go-review.googlesource.com/c/mod/+/375936 Trust: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent c2adaff commit 9b9b3d8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

zip/zip_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,12 +1037,11 @@ func TestVCS(t *testing.T) {
10371037
var downloadErrorCount int32
10381038
const downloadErrorLimit = 3
10391039

1040-
haveVCS := make(map[string]bool)
1041-
if _, err := gitPath(); err == nil {
1042-
haveVCS["git"] = true
1043-
}
1044-
if _, err := exec.LookPath("hg"); err == nil {
1045-
haveVCS["hg"] = true
1040+
_, gitErr := gitPath()
1041+
_, hgErr := exec.LookPath("hg")
1042+
haveVCS := map[string]bool{
1043+
"git": gitErr == nil,
1044+
"hg": hgErr == nil,
10461045
}
10471046

10481047
for _, test := range []struct {

0 commit comments

Comments
 (0)