Skip to content

Commit

Permalink
[JENKINS-16914] set remote.<remoteName>.url before fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof committed Feb 24, 2013
1 parent 8eeae81 commit 5e89884
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/hudson/plugins/git/GitSCM.java
Expand Up @@ -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;
Expand Down

0 comments on commit 5e89884

Please sign in to comment.