From e6c81cb8edda9160053a2091436802d138f6a520 Mon Sep 17 00:00:00 2001 From: Shivanker Goel Date: Thu, 2 Mar 2017 10:13:19 -0800 Subject: [PATCH] Fix broken dot-file upload. Summary: `Path::getFileName` returns another Path object. `Path::startsWith` returns true only if argument matches the full root component of the Path. We need filters on the string. #accept2ship Test Plan: CI, Ran distributed build with local version and verified it's picking up the files. Reviewed By: ruibm fbshipit-source-id: c4a7d00 --- src/com/facebook/buck/distributed/DistBuildService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/facebook/buck/distributed/DistBuildService.java b/src/com/facebook/buck/distributed/DistBuildService.java index 55ce2e96892..380fdfb6d17 100644 --- a/src/com/facebook/buck/distributed/DistBuildService.java +++ b/src/com/facebook/buck/distributed/DistBuildService.java @@ -347,11 +347,12 @@ public ListenableFuture uploadBuckDotFiles( executorService.submit(() -> { List buckDotFilesExceptConfig = Lists.newArrayList(); for (Path path : filesystem.getDirectoryContents(filesystem.getRootPath())) { + String fileName = path.getFileName().toString(); if (!filesystem.isDirectory(path) && !filesystem.isSymLink(path) && - path.getFileName().startsWith(".") && - path.getFileName().toString().contains("buck") && - !path.getFileName().startsWith(".buckconfig")) { + fileName.startsWith(".") && + fileName.contains("buck") && + !fileName.startsWith(".buckconfig")) { buckDotFilesExceptConfig.add(path); } }