Skip to content

Commit 7bebc65

Browse files
GlobalBuildInfo support packed-refs with work-tree (elastic#50791)
The packed-refs support was using the original .git path, changed to use the real .git directory after reference from worktree has been followed. Relates elastic#47464
1 parent be72e3f commit 7bebc65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,10 +1124,10 @@ class BuildPlugin implements Plugin<Project> {
11241124
Path refFile = gitDir.resolve(refName)
11251125
if (Files.exists(refFile)) {
11261126
revision = readFirstLine(refFile)
1127-
} else if (Files.exists(dotGit.resolve("packed-refs"))) {
1127+
} else if (Files.exists(gitDir.resolve("packed-refs"))) {
11281128
// Check packed references for commit ID
11291129
Pattern p = Pattern.compile("^([a-f1-9]{40}) " + refName + "\$")
1130-
Stream<String> lines = Files.lines(dotGit.resolve("packed-refs"));
1130+
Stream<String> lines = Files.lines(gitDir.resolve("packed-refs"));
11311131
try {
11321132
revision = lines.map( { s -> p.matcher(s) })
11331133
.filter( { m -> m.matches() })

0 commit comments

Comments
 (0)