Permalink
Browse files

[FIXED JENKINS-9661] Added a check to make sure we actually have the …

…remote defined locally before we prune it.
  • Loading branch information...
abayer committed May 11, 2011
1 parent 7530bc9 commit d6dc41c4992adeea20cc385e5681b770ea57f01c
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/main/java/hudson/plugins/git/GitAPI.java
@@ -231,10 +231,13 @@ public String describe(String commitIsh) throws GitException {
}

public void prune(RemoteConfig repository) throws GitException {
ArgumentListBuilder args = new ArgumentListBuilder();
args.add("remote", "prune", repository.getName());

launchCommand(args);
if (getRemoteUrl(repository.getName()) != null &&
!getRemoteUrl(repository.getName()).equals("")) {
ArgumentListBuilder args = new ArgumentListBuilder();
args.add("remote", "prune", repository.getName());

launchCommand(args);
}
}

private String firstLine(String result) {

0 comments on commit d6dc41c

Please sign in to comment.