Skip to content

Commit

Permalink
FilePath.toComputer no worse than what we already are doing in onChec…
Browse files Browse the repository at this point in the history
…kout, though JENKINS-26096 suggests improvements.

Originally-Committed-As: 5b778564c2f52397592e7c6ca5e5db2bf0452294
  • Loading branch information
jglick committed Mar 19, 2015
1 parent a63c3ee commit 83ea9d9
Showing 1 changed file with 4 additions and 13 deletions.
Expand Up @@ -511,21 +511,12 @@ private void onCheckout(SCM scm, FilePath workspace, @CheckForNull File changelo
l.onChangeLogParsed(this, scm, listener, cls);
}
}
String node = null;
// TODO: switch to FilePath.toComputer in 1.571
Jenkins j = Jenkins.getInstance();
if (j != null) {
for (Computer c : j.getComputers()) {
if (workspace.getChannel() == c.getChannel()) {
node = c.getName();
break;
}
}
}
if (node == null) {
// TODO JENKINS-26096 prefer a variant returning only Computer.name even if offline
Computer computer = workspace.toComputer();
if (computer == null) {
throw new IllegalStateException();
}
checkouts.add(new SCMCheckout(scm, node, workspace.getRemote(), changelogFile, pollingBaseline));
checkouts.add(new SCMCheckout(scm, computer.getName(), workspace.getRemote(), changelogFile, pollingBaseline));
}

static final class SCMCheckout {
Expand Down

0 comments on commit 83ea9d9

Please sign in to comment.