Update implementation of getCurrentBranch()