diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/GlobCache.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/GlobCache.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/GlobCache.java b/src/main/java/com/google/devtools/build/lib/packages/GlobCache.java index 43669a86bf..de9bfdfebc 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/GlobCache.java +++ b/src/main/java/com/google/devtools/build/lib/packages/GlobCache.java @@ -23,6 +23,7 @@ import com.google.common.util.concurrent.SettableFuture; import com.google.devtools.build.lib.concurrent.ThreadSafety; import com.google.devtools.build.lib.util.Pair; import com.google.devtools.build.lib.vfs.Path; +import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.vfs.Symlinks; import com.google.devtools.build.lib.vfs.UnixGlob; @@ -106,6 +107,7 @@ public class GlobCache { this.syscalls = syscalls == null ? new AtomicReference<>(UnixGlob.DEFAULT_SYSCALLS) : syscalls; Preconditions.checkNotNull(locator); + final PathFragment pkgNameFrag = packageId.getPackageFragment(); childDirectoryPredicate = new Predicate<Path>() { @Override public boolean apply(Path directory) { @@ -113,9 +115,7 @@ public class GlobCache { return true; } - PackageIdentifier subPackageId = new PackageIdentifier( - packageId.getRepository(), - packageId.getPackageFragment().getRelative(directory.relativeTo(packageDirectory))); + PathFragment pkgName = pkgNameFrag.getRelative(directory.relativeTo(packageDirectory)); UnixGlob.FilesystemCalls syscalls = GlobCache.this.syscalls.get(); if (syscalls != UnixGlob.DEFAULT_SYSCALLS) { // This is needed because in case the BUILD file exists, we do not call readdir() on its @@ -134,7 +134,7 @@ public class GlobCache { syscalls.statNullable(directory.getChild("BUILD"), Symlinks.FOLLOW); } - return locator.getBuildFileForPackage(subPackageId) == null; + return locator.getBuildFileForPackage(pkgName.getPathString()) == null; } }; } |