From 1078795d6f58948f7d209b0cae57100ac6ed336e Mon Sep 17 00:00:00 2001 From: abraunegg Date: Tue, 2 Mar 2021 14:28:31 +1100 Subject: [PATCH] Fix support for '/*' regardless of location within sync_list file (#1293) * Fix support for '/*' regardless of location within sync_list file --- src/selective.d | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/selective.d b/src/selective.d index 62a753aa..c050c037 100644 --- a/src/selective.d +++ b/src/selective.d @@ -223,7 +223,9 @@ private bool isPathExcluded(string path, string[] allowedPaths) // if there are no allowed paths always return false if (allowedPaths.empty) return false; path = buildNormalizedPath(path); - log.vdebug("Evaluation against 'sync_list' for: ", path); + log.vdebug("Evaluation against 'sync_list' for this path: ", path); + log.vdebug("[S]exclude = ", exclude); + log.vdebug("[S]excludeMatched = ", excludeMatched); // unless path is an exact match, entire sync_list entries need to be processed to ensure // negative matches are also correctly detected @@ -294,6 +296,8 @@ private bool isPathExcluded(string path, string[] allowedPaths) if (!exclude) { log.vdebug("Evaluation against 'sync_list' result: parental path match"); finalResult = false; + // parental path matches, break and go sync + break; } else { log.vdebug("Evaluation against 'sync_list' result: parental path match but must be excluded"); finalResult = true; @@ -317,10 +321,15 @@ private bool isPathExcluded(string path, string[] allowedPaths) } else { log.vdebug("Evaluation against 'sync_list' result: wildcard pattern matched but must be excluded"); finalResult = true; + excludeMatched = true; } } } } + // Interim results + log.vdebug("[F]exclude = ", exclude); + log.vdebug("[F]excludeMatched = ", excludeMatched); + // results if (finalResult) { log.vdebug("Evaluation against 'sync_list' final result: EXCLUDED");