/** {@inheritDoc} */ public String getRemoteUrl(String name) throws GitException, InterruptedException { return proxy.getRemoteUrl(name); }
/** {@inheritDoc} */ public String getRemoteUrl(String name) throws GitException, InterruptedException { return Git.USE_CLI ? super.getRemoteUrl(name) : jgit.getRemoteUrl(name); }
private void addRemoteRepoToConfig(GitClient client) throws InterruptedException { GitSCM gitScm = getJenkinsScm(); for (RemoteConfig uc : gitScm.getRepositories()) { if (client.getRemoteUrl(uc.getName()) == null) client.setRemoteUrl(uc.getName(), uc.getURIs().get(0).toPrivateASCIIString()); } }
@Override public Void run(GitClient client, String remoteName) throws IOException, InterruptedException { final Repository repository = client.getRepository(); try (RevWalk walk = new RevWalk(repository); GitSCMSourceRequest request = context.newRequest(AbstractGitSCMSource.this, listener)) { Map<String, ObjectId> remoteReferences = null; if (context.wantBranches() || context.wantTags()) { listener.getLogger().println("Listing remote references..."); remoteReferences = client.getRemoteReferences( client.getRemoteUrl(remoteName), null, context.wantBranches(), context.wantTags() ); } if (context.wantBranches()) { discoverBranches(repository, walk, request, remoteReferences); } if (context.wantTags()) { discoverTags(repository, walk, request, remoteReferences); } } return null; }