You might expect new FilePath(null, "/local/path").getChannel() to be null.

Confusingly, it is instead MasterComputer.localChannel!
If that is fed back into FilePath.<init>(VirtualChannel,String) rather than using .<init>(FilePath,String)
you get an object that behaves strangely and throws exceptions.
This commit is contained in:
Jesse Glick committed 2013-08-19 16:19:20 -04:00
1 parent 34a461eb40
commit 957595d2b4
1 file changed
+1 -1
+1 -1
View File
@@ -196,7 +196,7 @@ public final class FilePath implements Serializable {
* that's connected to that machine. If null, that means the local file path.
*/
public FilePath(VirtualChannel channel, String remote) {
this.channel = channel;
this.channel = channel == Jenkins.MasterComputer.localChannel ? null : channel;
this.remote = normalize(remote);
}