Skip to content
Permalink
Browse files
[JENKINS-16914] set remote.<remoteName>.url before fetch
  • Loading branch information
ndeloof committed Feb 24, 2013
1 parent 8eeae81 commit 5e898848a12a4923b7d882bdab0a31cd12ee9c44
Showing 1 changed file with 6 additions and 3 deletions.
@@ -792,14 +792,17 @@ private void cleanSubmodules(GitClient parentGit,
private boolean fetchFrom(GitClient git,
TaskListener listener,
RemoteConfig remoteRepository) {
String name = remoteRepository.getName();
try {
// Assume there is only 1 URL / refspec for simplicity
git.fetch(remoteRepository.getURIs().get(0).toPrivateString(), remoteRepository.getFetchRefSpecs().get(0));
String url = remoteRepository.getURIs().get(0).toPrivateString();
git.setRemoteUrl(name, url);
git.fetch(name, remoteRepository.getFetchRefSpecs().get(0));
return true;
} catch (GitException ex) {
ex.printStackTrace(listener.error(
"Problem fetching from " + remoteRepository.getName()
+ " / " + remoteRepository.getName()
"Problem fetching from " + name
+ " / " + name
+ " - could be unavailable. Continuing anyway"));
}
return false;

0 comments on commit 5e89884

Please sign in to comment.