Ensure that feature branches are children of the same major branches
This change addresses a bug where if the immediate branch
targets are on different major branches, the target for the
higher major branch can be considered a child of an older major
branch. This occurs when the one of the targets is a release branch
for 6.x.x and the other is 5.x where the feature branch of 5.x is
greater than that of the 6.x target.
Fixes: QTQAINFRA-6200
Change-Id: Id061740c70bd6215ddb03aa74cf4133bcb074c76
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>