Skip to content

Commit 795af09

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
internal/task: check the error from Git.Clone in FakeCloudBuild.RunScript
This should fix the nil-panic reported in golang/go#63239. (I suspect that it will expose some other failure mode, though.) Fixes golang/go#63239. Change-Id: I4f432c569d632863fc928c5fea5764b163979456 Reviewed-on: https://go-review.googlesource.com/c/build/+/530737 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]>
1 parent a832c7f commit 795af09

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/task/fakes.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,9 @@ func (cb *FakeCloudBuild) RunScript(ctx context.Context, script string, gerritPr
798798
return CloudBuild{}, err
799799
}
800800
dir, err := (&Git{}).Clone(ctx, repo.dir.dir)
801+
if err != nil {
802+
return CloudBuild{}, err
803+
}
801804
defer dir.Close()
802805
wd = dir.dir
803806
} else {

0 commit comments

Comments
 (0)