When trying to find a branch, ensure branch name is set before using it