use of org.jetbrains.plugins.github.api.data.GithubRepoDetailed in project intellij-community by JetBrains.
the class GithubCreatePullRequestWorker method doLoadForksFromGithub.
private void doLoadForksFromGithub(@NotNull ProgressIndicator indicator) throws IOException {
GithubRepoDetailed repo = GithubUtil.runTask(myProject, myAuthHolder, indicator, connection -> GithubApiUtil.getDetailedRepoInfo(connection, myPath.getUser(), myPath.getRepository()));
doAddFork(repo, indicator);
if (repo.getParent() != null) {
doAddFork(repo.getParent(), indicator);
}
if (repo.getSource() != null) {
doAddFork(repo.getSource(), indicator);
}
mySource = repo.getSource() == null ? repo.getFullPath() : repo.getSource().getFullPath();
}
use of org.jetbrains.plugins.github.api.data.GithubRepoDetailed in project intellij-community by JetBrains.
the class GithubShareProjectTest method checkGithubExists.
protected void checkGithubExists() throws IOException {
GithubAuthData auth = myGitHubSettings.getAuthData();
GithubRepoDetailed githubInfo = GithubApiUtil.getDetailedRepoInfo(new GithubConnection(auth), myLogin1, PROJECT_NAME);
assertNotNull("GitHub repository does not exist", githubInfo);
}
use of org.jetbrains.plugins.github.api.data.GithubRepoDetailed in project intellij-community by JetBrains.
the class GithubRebaseAction method configureUpstreamRemote.
@Nullable
static String configureUpstreamRemote(@NotNull Project project, @NotNull GitRepository gitRepository, @NotNull ProgressIndicator indicator) {
GithubRepoDetailed repositoryInfo = loadRepositoryInfo(project, gitRepository, indicator);
if (repositoryInfo == null) {
return null;
}
if (!repositoryInfo.isFork() || repositoryInfo.getParent() == null) {
GithubNotifications.showWarningURL(project, CANNOT_PERFORM_GITHUB_REBASE, "GitHub repository ", "'" + repositoryInfo.getName() + "'", " is not a fork", repositoryInfo.getHtmlUrl());
return null;
}
final String parentRepoUrl = GithubUrlUtil.getCloneUrl(repositoryInfo.getParent().getFullPath());
LOG.info("Adding GitHub parent as a remote host");
indicator.setText("Adding GitHub parent as a remote host...");
if (GithubUtil.addGithubRemote(project, gitRepository, "upstream", parentRepoUrl)) {
return parentRepoUrl;
} else {
return null;
}
}
Aggregations