Skip to content
Permalink
Browse files

[FIXED JENKINS-10348] Moved prune to after fetch.

  • Loading branch information
abayer committed Jul 15, 2011
1 parent 200c8d9 commit dc415ec38e7fd38475fe31c3abe68b73136899bd
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/main/java/hudson/plugins/git/GitSCM.java
@@ -939,14 +939,6 @@ public Revision invoke(File localWorkspace, VirtualChannel channel)
if (git.hasGitRepo()) {
// It's an update

// Do we want to prune first?
if (pruneBranches) {
log.println("Pruning obsolete local branches");
for (RemoteConfig remoteRepository : paramRepos) {
git.prune(remoteRepository);
}
}

if (paramRepos.size() == 1)
log.println("Fetching changes from 1 remote Git repository");
else
@@ -966,6 +958,13 @@ public Revision invoke(File localWorkspace, VirtualChannel channel)
listener.error("Could not fetch from any repository");
throw new GitException("Could not fetch from any repository");
}
// Do we want to prune first?
if (pruneBranches) {
log.println("Pruning obsolete local branches");
for (RemoteConfig remoteRepository : paramRepos) {
git.prune(remoteRepository);
}
}

} else {

0 comments on commit dc415ec

Please sign in to comment.
You can’t perform that action at this time.