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());
}
Aggregations