diff --git a/src/main/java/hudson/plugins/git/GitSCM.java b/src/main/java/hudson/plugins/git/GitSCM.java index 50adb86c74..cfb6417d40 100644 --- a/src/main/java/hudson/plugins/git/GitSCM.java +++ b/src/main/java/hudson/plugins/git/GitSCM.java @@ -78,6 +78,7 @@ import java.io.Serializable; import java.io.Writer; import java.nio.file.Files; +import java.nio.file.InvalidPathException; import java.nio.file.Paths; import java.text.MessageFormat; import java.util.AbstractList; @@ -104,7 +105,6 @@ import hudson.Util; import hudson.plugins.git.extensions.impl.ScmName; import hudson.util.LogTaskListener; -import java.nio.file.InvalidPathException; import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -1409,8 +1409,7 @@ void abortIfSourceIsLocal() throws AbortException { private static boolean isRemoteUrlValid(String remoteUrl) { if (remoteUrl == null) { return true; - } - if (remoteUrl.toLowerCase(Locale.ENGLISH).startsWith("file://")) { + } else if (remoteUrl.toLowerCase(Locale.ENGLISH).startsWith("file://")) { return false; } try {