Skip to content

Commit 9cc1795

Browse files
authored
fix: Properly use HasPrefix instead of HasSuffix to check if its a tag (#80)
1 parent 534f1a4 commit 9cc1795

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/gitprojector_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func (r *GitProjectorReconciler) doReconcile(ctx context.Context, obj *templates
224224
var ref templatesv1alpha1.GitRef
225225
if strings.HasPrefix(name, "refs/heads/") {
226226
ref.Branch = strings.TrimPrefix(name, "refs/heads/")
227-
} else if strings.HasSuffix(name, "refs/tags/") {
227+
} else if strings.HasPrefix(name, "refs/tags/") {
228228
ref.Tag = strings.TrimPrefix(name, "refs/tags/")
229229
} else {
230230
return fmt.Errorf("could not determine ref type for %s", name)

0 commit comments

Comments
 (0)