Test: update the branch logic for BWC tests
Test: update the branch logic for BWC tests

This commit updates the logic for determining which branch to use to make it consistent with the
logic in elasticsearch. This change means that testing BWC within the same major picks the correct
branch.

Original commit: elastic/x-pack-elasticsearch@2d75d15c41bb755a0a41ae255777fe6ce8fdf5b7

nknize/elasticsearch,uschindler/elasticsearch,uschindler/elasticsearch,GlenRSmith/elasticsearch,coding0011/elasticsearch,gingerwizard/elasticsearch,gingerwizard/elasticsearch,scorpionvicky/elasticsearch,HonzaKral/elasticsearch,robin13/elasticsearch,nknize/elasticsearch,GlenRSmith/elasticsearch,robin13/elasticsearch,gfyoung/elasticsearch,gingerwizard/elasticsearch,nknize/elasticsearch,coding0011/elasticsearch,coding0011/elasticsearch,uschindler/elasticsearch,nknize/elasticsearch,GlenRSmith/elasticsearch,HonzaKral/elasticsearch,gingerwizard/elasticsearch,GlenRSmith/elasticsearch,robin13/elasticsearch,gingerwizard/elasticsearch,gingerwizard/elasticsearch,HonzaKral/elasticsearch,scorpionvicky/elasticsearch,HonzaKral/elasticsearch,uschindler/elasticsearch,GlenRSmith/elasticsearch,uschindler/elasticsearch,scorpionvicky/elasticsearch,coding0011/elasticsearch,gfyoung/elasticsearch,gfyoung/elasticsearch,robin13/elasticsearch,scorpionvicky/elasticsearch,robin13/elasticsearch,gfyoung/elasticsearch,scorpionvicky/elasticsearch,gingerwizard/elasticsearch,gfyoung/elasticsearch,nknize/elasticsearch,coding0011/elasticsearch