Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #2896 #2897

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/clientSideFiltering.d
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ class ClientSideFiltering {
if (line.length == 0 || line[0] == ';' || line[0] == '#') continue;

// Is the rule a legacy 'include all root files lazy rule?'
if (strip(line) == "/*") {
if ((strip(line) == "/*") || (strip(line) == "/")) {
// yes ...
string errorMessage = "ERROR: Invalid sync_list rule '" ~ to!string(strip(line)) ~ "' detected. Please use 'sync_root_files = \"true\"' or --sync-root-files option to sync files in the root path.";
addLogEntry();
addLogEntry("ERROR: Invalid sync_list rule '/*' detected. Please use 'sync_root_files = \"true\"' or --sync-root-files option to sync files in the root path.", ["info", "notify"]);
addLogEntry(errorMessage, ["info", "notify"]);
addLogEntry();
} else {
syncListRules ~= buildNormalizedPath(line);
Expand Down Expand Up @@ -662,6 +663,11 @@ class ClientSideFiltering {
addLogEntry("Rule Segments: " ~ to!string(ruleSegments), ["debug"]);
addLogEntry("Input Segments: " ~ to!string(inputSegments), ["debug"]);
}

// Check that both segments are not empty
if (ruleSegments.length == 0 || inputSegments.length == 0) {
return false; // Return false if either segment array is empty
}

// Compare the first segments only
return equal(ruleSegments[0], inputSegments[0]);
Expand Down
Loading