[backport-1.5]: sylva-core branch detection wrongly select a dev branch
A solution for issue sylva-projects/sylva-core#3661 needs to be backported to 1.5.x
issue