Skip to content
Permalink
Browse files
Merge pull request #143 from woohgit/master
[JENKINS-14575] Fix to make the retry logic work with GitSCM
  • Loading branch information
ndeloof committed Apr 4, 2013
2 parents 086f185 + 3f135da commit f49bc41caf1def82d40aef3f6cbe08547cff48d2
Showing 2 changed files with 12 additions and 4 deletions.
@@ -10,3 +10,4 @@ work
nbactions.xml
release.properties
pom.xml.releaseBackup
.idea
@@ -973,12 +973,17 @@ public Collection<Revision> invoke(File localWorkspace, VirtualChannel channel)

boolean fetched = false;
for (RemoteConfig remoteRepository : repos) {
fetched |= fetchFrom(git, listener, remoteRepository);
try {
fetched |= fetchFrom(git, listener, remoteRepository);
} catch (GitException e) {
fetched |= false;
}
}

if (!fetched) {
listener.error("Could not fetch from any repository");
throw new GitException("Could not fetch from any repository");
// Throw IOException so the retry will be able to catch it
throw new IOException("Could not fetch from any repository");
}
// Do we want to prune first?
if (pruneBranches) {
@@ -1010,7 +1015,8 @@ public Collection<Revision> invoke(File localWorkspace, VirtualChannel channel)

if (!successfullyCloned) {
listener.error("Could not clone repository");
throw new GitException("Could not clone");
// Throw IOException so the retry will be able to catch it
throw new IOException("Could not clone");
}

boolean fetched = false;
@@ -1020,7 +1026,8 @@ public Collection<Revision> invoke(File localWorkspace, VirtualChannel channel)

if (!fetched) {
listener.error("Could not fetch from any repository");
throw new GitException("Could not fetch from any repository");
// Throw IOException so the retry will be able to catch it
throw new IOException("Could not fetch from any repository");
}

if (clean) {

0 comments on commit f49bc41

Please sign in to comment.