Skip to content

Commit

Permalink
[FIXED JENKINS-9661] Added a check to make sure we actually have the …
Browse files Browse the repository at this point in the history
…remote defined locally before we prune it.
  • Loading branch information
abayer committed May 11, 2011
1 parent 7530bc9 commit d6dc41c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/hudson/plugins/git/GitAPI.java
Expand Up @@ -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) {
Expand Down

0 comments on commit d6dc41c

Please sign in to comment.