Skip to content

Commit eaaf938

Browse files
authored
Fix bug in loadTasks (#4101)
Signed-off-by: Morten Torkildsen <[email protected]>
1 parent 701cc72 commit eaaf938

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

porch/pkg/git/git.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,12 @@ func (r *gitRepository) loadTasks(ctx context.Context, startCommit *object.Commi
11181118

11191119
var tasks []v1alpha1.Task
11201120

1121+
done := false
11211122
visitCommit := func(commit *object.Commit) error {
1123+
if done {
1124+
return nil
1125+
}
1126+
11221127
gitAnnotations, err := ExtractGitAnnotations(commit)
11231128
if err != nil {
11241129
return err
@@ -1143,6 +1148,7 @@ func (r *gitRepository) loadTasks(ctx context.Context, startCommit *object.Commi
11431148
if gitAnnotation.Task != nil && (gitAnnotation.Task.Type == v1alpha1.TaskTypeClone || gitAnnotation.Task.Type == v1alpha1.TaskTypeInit) {
11441149
// we have reached the beginning of this package revision and don't need to
11451150
// continue further
1151+
done = true
11461152
break
11471153
}
11481154
}

0 commit comments

Comments
 (0)