A common use case for linkage check is verifying someone else's PR, which does not involve any branches, but merging two non-branch references. The script assumes you are on a branch, so it does not work well for this use case.
Imported from Jira BEAM-11261. Original Jira may contain additional context.
Reported by: kenn.