Currently, the scanner has no notion of default target branch.
This information wasn't needed before: if the target branch wasn't specified, it wouldn't be sent to the server and in that case the server would use the main branch as the target branch.
Now we ask the SCM plugins, on the scanner side, to provide lists of changed files or lines between the current branch and the target branch.
If the target branch is not provided by the user, we need to figure out what is the default target branch in the scanner so that we can pass it to the SCM plugin.
Otherwise we won't have a precise information about which files and lines are modified in the branch.
For short-lived branches (where a CI cannot possibly know the base branch) fall back to the default branch when sonar.branch.target is not specified.