I'd use `get_default_branch` instead of `HEAD` here.