Skip to content

Commit

Permalink
fix(directives): check for nil commit in git-clone
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
  • Loading branch information
hiddeco committed Sep 18, 2024
1 parent 212ba8b commit e427378
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/directives/git_clone_directive.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ func (g *gitCloneDirective) run(
return Result{Status: StatusFailure},
fmt.Errorf("error finding commit from repo %s: %w", cfg.RepoURL, err)
}
if commit == nil {
return Result{Status: StatusFailure},
fmt.Errorf("could not find any commit from repo %s", cfg.RepoURL)

Check warning on line 145 in internal/directives/git_clone_directive.go

View check run for this annotation

Codecov / codecov/patch

internal/directives/git_clone_directive.go#L143-L145

Added lines #L143 - L145 were not covered by tests
}
ref = commit.ID
case checkout.Tag != "":
ref = checkout.Tag
Expand Down

0 comments on commit e427378

Please sign in to comment.