private void updateComponents(@Nullable GitPushTarget target) {
    myCurrentTarget = target;

    boolean noRemotes = myRepository.getRemotes().isEmpty();
    if (myRepository.isFresh()) {
      myError = GitBundle.message("push.dialog.target.panel.empty.repository");
    }
    else if (target == null && !noRemotes) {
      myError = GitBundle.message("push.dialog.target.panel.can.t.push");
    }

    String initialBranch = "";
    String initialRemote = "";
    if (target != null) {
      initialBranch = getTextFieldText(target);
      initialRemote = target.getBranch().getRemote().getName();
    }

    myTargetRenderer.updateLinkText(initialBranch);
    myTargetEditor.setText(initialBranch);
    myRemoteRenderer.updateLinkText(noRemotes ? GitBundle.message("push.dialog.target.panel.define.remote") : initialRemote);

    myTargetEditor.setVisible(!noRemotes);
  }
private void updateComponents(@Nullable GitPushTarget target)