Search in sources :

Example 1 with GitHubApiTransportWithChecker

use of com.google.copybara.git.github.api.GitHubApiTransportWithChecker in project copybara by google.

the class GitHubOptions method newGitHubApi.

/**
 * Returns a new {@link GitHubApi} instance for the given project  enforcing the given
 * {@link Checker}.
 *
 * <p>The project for 'https://github.com/foo/bar' is 'foo/bar'.
 */
public GitHubApi newGitHubApi(String gitHubProject, @Nullable Checker checker, Console console) throws RepoException {
    GitRepository repo = getCredentialsRepo();
    String storePath = gitOptions.getCredentialHelperStorePath();
    if (storePath == null) {
        storePath = "~/.git-credentials";
    }
    GitHubApiTransport transport = newTransport(repo, storePath, console);
    if (checker != null) {
        transport = new GitHubApiTransportWithChecker(transport, new ApiChecker(checker, console));
    }
    return new GitHubApi(transport, generalOptions.profiler());
}
Also used : GitHubApiTransport(com.google.copybara.git.github.api.GitHubApiTransport) ApiChecker(com.google.copybara.checks.ApiChecker) GitHubApi(com.google.copybara.git.github.api.GitHubApi) GitHubApiTransportWithChecker(com.google.copybara.git.github.api.GitHubApiTransportWithChecker)

Aggregations

ApiChecker (com.google.copybara.checks.ApiChecker)1 GitHubApi (com.google.copybara.git.github.api.GitHubApi)1 GitHubApiTransport (com.google.copybara.git.github.api.GitHubApiTransport)1 GitHubApiTransportWithChecker (com.google.copybara.git.github.api.GitHubApiTransportWithChecker)1