add a test for getCurrentBranch and fix the bug
fix regressions