Auto-detect the current branch