fix to support nested branches and similar branches with the same suffix.
for example:
develop
beta/develop