private static String createPushSpec(@NotNull GitPushSource source,
                                       @NotNull GitPushTarget target,
                                       boolean setUpstream) {
    boolean needFullRefName = setUpstream || !source.isBranchRef();
    String remoteBranchName = target.getBranch().getNameForRemoteOperations();
    String targetRef = needFullRefName && !remoteBranchName.startsWith("refs/")
                       ? GitBranch.REFS_HEADS_PREFIX + remoteBranchName
                       : remoteBranchName;

    return source.getRevision() + ":" + targetRef;
  }
private static String createPushSpec(@NotNull GitPushSource source,
                                       @NotNull GitPushTarget target,
                                       boolean setUpstream)