Make RepositoryName comparison case-insensitive on Windows
Fixed
RELNOTES: None
@@ -19,6 +19,7 @@ import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
+import com.google.devtools.build.lib.util.OS;
import com.google.devtools.build.lib.util.Pair;
import com.google.devtools.build.lib.util.StringCanonicalizer;
import com.google.devtools.build.lib.util.StringUtilities;
@@ -260,11 +261,18 @@ public final class RepositoryName implements Serializable {
if (!(object instanceof RepositoryName)) {
return false;
}
+
+ if (OS.getCurrent() == OS.WINDOWS) {
+ return name.toLowerCase().equals(((RepositoryName) object).name.toLowerCase());
+ }
return name.equals(((RepositoryName) object).name);
}
@Override
public int hashCode() {
+ if (OS.getCurrent() == OS.WINDOWS) {
+ return name.toLowerCase().hashCode();
+ }
return name.hashCode();
}
}
