Skip to content

Commit

Permalink
prow: check for empty refs on fetch call
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kuznetsov <[email protected]>
  • Loading branch information
stevekuznetsov committed May 24, 2021
1 parent 6d26804 commit 036f593
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prow/repoowners/repoowners.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ func (c *Client) LoadRepoOwners(org, repo, base string) (RepoOwner, error) {
if err != nil {
return nil, fmt.Errorf("failed to get current SHA for %s: %v", fullName, err)
}
if sha == "" {
return nil, fmt.Errorf("got an empty SHA for %s@heads/%s", fullName, base)
}
log.WithField("duration", time.Since(start).String()).Debugf("Completed ghc.GetRef(%s, %s, %s)", org, repo, fmt.Sprintf("heads/%s", base))

entry, err := c.cacheEntryFor(org, repo, base, cloneRef, fullName, sha, log)
Expand Down

0 comments on commit 036f593

Please sign in to comment.