private void doConfigureRemote(@NotNull ForkInfo fork) { if (fork.getRemoteName() != null) return; GithubFullPath path = fork.getPath(); String url = GithubUrlUtil.getCloneUrl(path); if (GithubUtil.addGithubRemote(myProject, myGitRepository, path.getUser(), url)) { fork.setRemoteName(path.getUser()); } }
@Nullable private GithubPullRequest doCreatePullRequest( @NotNull ProgressIndicator indicator, @NotNull final BranchInfo branch, @NotNull final String title, @NotNull final String description) { final ForkInfo fork = branch.getForkInfo(); final String head = myPath.getUser() + ":" + myCurrentBranch; final String base = branch.getRemoteName(); try { return GithubUtil.runTask( myProject, myAuthHolder, indicator, new ThrowableConvertor<GithubConnection, GithubPullRequest, IOException>() { @NotNull @Override public GithubPullRequest convert(@NotNull GithubConnection connection) throws IOException { return GithubApiUtil.createPullRequest( connection, fork.getPath().getUser(), fork.getPath().getRepository(), title, description, head, base); } }); } catch (IOException e) { GithubNotifications.showError(myProject, CANNOT_CREATE_PULL_REQUEST, e); return null; } }
@Override public String toString() { return myPath.getUser() + ":" + myPath.getRepository(); }