[tor-commits] [metrics-lib/master] Make tests pass again and solve task-22190.

karsten at torproject.org karsten at torproject.org
Wed May 10 12:27:03 UTC 2017


commit e927475c12db02e492075e8a6a580e2626c94037
Author: iwakeh <iwakeh at torproject.org>
Date:   Tue May 9 15:17:09 2017 +0000

    Make tests pass again and solve task-22190.
---
 .../org/torproject/descriptor/index/DescriptorIndexCollector.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/torproject/descriptor/index/DescriptorIndexCollector.java b/src/main/java/org/torproject/descriptor/index/DescriptorIndexCollector.java
index 68b6591..4796263 100644
--- a/src/main/java/org/torproject/descriptor/index/DescriptorIndexCollector.java
+++ b/src/main/java/org/torproject/descriptor/index/DescriptorIndexCollector.java
@@ -144,7 +144,9 @@ public class DescriptorIndexCollector implements DescriptorCollector {
       File localDir, SortedMap<String, Long> locals) {
     for (String localPath : locals.keySet()) {
       for (String remoteDirectory : remoteDirectories) {
-        if (localPath.startsWith(remoteDirectory)) {
+        String remDir = remoteDirectory.charAt(0) == '/'
+            ? remoteDirectory.substring(1) : remoteDirectory;
+        if (localPath.startsWith(remDir)) {
           if (!remoteFiles.containsKey(localPath)) {
             File extraneousLocalFile = new File(localDir, localPath);
             log.debug("Deleting extraneous local file {}.",





More information about the tor-commits mailing list