From 486a96463fc594ef06d47342b7533164d11fbbd2 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 8 Mar 2023 01:31:02 -0800 Subject: [PATCH] Use the isOutput helper in various RemoteActionFileSystem methods. PiperOrigin-RevId: 514968339 Change-Id: I8417a28fc0e64f75074bec83515c7af84890863b --- .../build/lib/remote/RemoteActionFileSystem.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java index 28ee9babf324f6..72fb436daa553c 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java @@ -231,7 +231,7 @@ public String getFileSystemType(PathFragment path) { @Override protected boolean delete(PathFragment path) throws IOException { boolean deleted = super.delete(path); - if (path.startsWith(outputBase)) { + if (isOutput(path)) { deleted = remoteOutputTree.getPath(path).delete() || deleted; } return deleted; @@ -391,7 +391,7 @@ protected PathFragment readSymbolicLink(PathFragment path) throws IOException { protected void createSymbolicLink(PathFragment linkPath, PathFragment targetFragment) throws IOException { super.createSymbolicLink(linkPath, targetFragment); - if (linkPath.startsWith(outputBase)) { + if (isOutput(linkPath)) { remoteOutputTree.getPath(linkPath).createSymbolicLink(targetFragment); } } @@ -567,7 +567,7 @@ protected RemoteFileArtifactValue getRemoteMetadata(PathFragment path) { @Nullable private TreeArtifactValue getRemoteTreeMetadata(PathFragment path) { - if (!path.startsWith(outputBase)) { + if (!isOutput(path)) { return null; } PathFragment execPath = path.relativeTo(execRoot); @@ -627,7 +627,7 @@ public void renameTo(PathFragment sourcePath, PathFragment targetPath) throws IO @Override public void createDirectoryAndParents(PathFragment path) throws IOException { super.createDirectoryAndParents(path); - if (path.startsWith(outputBase)) { + if (isOutput(path)) { remoteOutputTree.createDirectoryAndParents(path); } } @@ -636,7 +636,7 @@ public void createDirectoryAndParents(PathFragment path) throws IOException { @Override public boolean createDirectory(PathFragment path) throws IOException { boolean created = delegateFs.createDirectory(path); - if (path.startsWith(outputBase)) { + if (isOutput(path)) { created = remoteOutputTree.createDirectory(path) || created; } return created;