Skip to content

Commit

Permalink
[JENKINS-14575] Wrap GitException into IOException
Browse files Browse the repository at this point in the history
Do the same if the repo exists and don't have to clone.
  • Loading branch information
Adam PAPAI committed Mar 28, 2013
1 parent d82a9f3 commit 33e66e1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/hudson/plugins/git/GitSCM.java
Expand Up @@ -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) {
Expand Down

0 comments on commit 33e66e1

Please sign in to comment.