Skip local branch name if remote branch is empty and local branch is unknown to remote. Closes #2142.