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