Fix detection of non-numeric branch names in waterfall logic
Non-numeric branches cannot follow a logical order for cherry-
picking. This patch fixes a bug where a crash would occur
if the source branch was non-numeric, but the target branch
was numeric/dev/master. The waterfall logic will now correctly
return a flat list of targets when either source or target branches
are non-compliant.
Fixes: QTQAINFRA-6241
Change-Id: If228ed0a49e566873b9c2677ca3c675b698fc669
Reviewed-by: Daniel Smith <daniel.smith@qt.io>