Skip to content

Commit

Permalink
Use the isOutput helper in various RemoteActionFileSystem methods.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 514968339
Change-Id: I8417a28fc0e64f75074bec83515c7af84890863b
  • Loading branch information
tjgq authored and copybara-github committed Mar 8, 2023
1 parent 2f98b92 commit 486a964
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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;
Expand Down

0 comments on commit 486a964

Please sign in to comment.