Skip to content

Commit

Permalink
Fix bug in loadTasks (#4101)
Browse files Browse the repository at this point in the history
Signed-off-by: Morten Torkildsen <[email protected]>
  • Loading branch information
mortent authored Dec 11, 2023
1 parent 701cc72 commit eaaf938
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions porch/pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,12 @@ func (r *gitRepository) loadTasks(ctx context.Context, startCommit *object.Commi

var tasks []v1alpha1.Task

done := false
visitCommit := func(commit *object.Commit) error {
if done {
return nil
}

gitAnnotations, err := ExtractGitAnnotations(commit)
if err != nil {
return err
Expand All @@ -1143,6 +1148,7 @@ func (r *gitRepository) loadTasks(ctx context.Context, startCommit *object.Commi
if gitAnnotation.Task != nil && (gitAnnotation.Task.Type == v1alpha1.TaskTypeClone || gitAnnotation.Task.Type == v1alpha1.TaskTypeInit) {
// we have reached the beginning of this package revision and don't need to
// continue further
done = true
break
}
}
Expand Down

0 comments on commit eaaf938

Please sign in to comment.