apply script generates an invalid "branch" field on SylvaUnitsRelease

regression due to !6392 (merged): we see errors like this in dev-environments

$ k get gitrepository sylva-units-0243979a
NAME                   URL                                                AGE   READY   STATUS
sylva-units-0243979a   https://gitlab.com/sylva-projects/sylva-core.git   12m   False   failed to checkout and determine revision: unable to clone 'https://gitlab.com/sylva-projects/sylva-core.git': couldn't find remote ref "refs/heads/origin"

This is due to the result of git branch --remotes --contains $SYLVA_CORE_COMMIT --format='%(refname:short) when run on main.

This wasn't visible when testing !6392 (merged) in a the dev branch of the MR.

Assignee Loading
Time tracking Loading