authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-10-12 15:48:16-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-10-12 15:48:16-07:00
log67ee68fc9eb02b78d7a2c26c617a16f60f91012d
tree81e7cfea212039bc264fed9aaabc4a0662a27cec
parentb37fdf387a10bf76facc85a882f9ec7a8279c17a
parentb9f75a39d3db7831ec37c81ffaf485e49dff5501
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #17498 from ziglang/fix-fetch

path-related fixes for Package.Fetch and Package.Manifest

2 files changed, 3 insertions(+), 1 deletions(-)

src/Package/Fetch.zig+2
...@@ -1507,6 +1507,7 @@ const Filter = struct {...@@ -1507,6 +1507,7 @@ const Filter = struct {
1507 pub fn includePath(self: Filter, sub_path: []const u8) bool {1507 pub fn includePath(self: Filter, sub_path: []const u8) bool {
1508 if (self.include_paths.count() == 0) return true;1508 if (self.include_paths.count() == 0) return true;
1509 if (self.include_paths.contains("")) return true;1509 if (self.include_paths.contains("")) return true;
1510 if (self.include_paths.contains(".")) return true;
1510 if (self.include_paths.contains(sub_path)) return true;1511 if (self.include_paths.contains(sub_path)) return true;
15111512
1512 // Check if any included paths are parent directories of sub_path.1513 // Check if any included paths are parent directories of sub_path.
...@@ -1571,4 +1572,5 @@ const ErrorBundle = std.zig.ErrorBundle;...@@ -1571,4 +1572,5 @@ const ErrorBundle = std.zig.ErrorBundle;
15711572
1572test {1573test {
1573 _ = Filter;1574 _ = Filter;
1575 _ = FileType;
1574}1576}
src/Package/Manifest.zig+1-1
...@@ -313,7 +313,7 @@ const Parse = struct {...@@ -313,7 +313,7 @@ const Parse = struct {
313 var buf: [2]Ast.Node.Index = undefined;313 var buf: [2]Ast.Node.Index = undefined;
314 const array_init = ast.fullArrayInit(&buf, node) orelse {314 const array_init = ast.fullArrayInit(&buf, node) orelse {
315 const tok = main_tokens[node];315 const tok = main_tokens[node];
316 return fail(p, tok, "expected paths expression to be a struct", .{});316 return fail(p, tok, "expected paths expression to be a list of strings", .{});
317 };317 };
318318
319 for (array_init.ast.elements) |elem_node| {319 for (array_init.ast.elements) |elem_node| {