Skip to content

Commit af76cf3

Browse files
authored
Use path separator for git path in transport resources (#133228)
When looking up files from main in transport resources, the system dependent path is used. However, the beginning slash also needs to be system dependent.
1 parent a8d6582 commit af76cf3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionResourcesService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.gradle.process.ExecResult;
1717

1818
import java.io.ByteArrayOutputStream;
19+
import java.io.File;
1920
import java.io.IOException;
2021
import java.nio.charset.StandardCharsets;
2122
import java.nio.file.Files;
@@ -199,7 +200,8 @@ private <T> T getMainFile(String resourcePath, BiFunction<String, String, T> par
199200
if (getMainResources().contains(resourcePath) == false) {
200201
return null;
201202
}
202-
String content = gitCommand("show", "main:./" + resourcePath).strip();
203+
204+
String content = gitCommand("show", "main:." + File.separator + resourcePath).strip();
203205
return parser.apply(resourcePath, content);
204206
}
205207

0 commit comments

Comments
 (0)