Fixes the handling of git branch for multiple branches