String (@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; }