Merge pull request #17498 from ziglang/fix-fetch

path-related fixes for Package.Fetch and Package.Manifest
This commit is contained in:
Andrew Kelley 2023-10-12 15:48:16 -07:00 committed by GitHub
commit 67ee68fc9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1507,6 +1507,7 @@ const Filter = struct {
pub fn includePath(self: Filter, sub_path: []const u8) bool {
if (self.include_paths.count() == 0) return true;
if (self.include_paths.contains("")) return true;
if (self.include_paths.contains(".")) return true;
if (self.include_paths.contains(sub_path)) return true;
// Check if any included paths are parent directories of sub_path.
@ -1571,4 +1572,5 @@ const ErrorBundle = std.zig.ErrorBundle;
test {
_ = Filter;
_ = FileType;
}

View File

@ -313,7 +313,7 @@ const Parse = struct {
var buf: [2]Ast.Node.Index = undefined;
const array_init = ast.fullArrayInit(&buf, node) orelse {
const tok = main_tokens[node];
return fail(p, tok, "expected paths expression to be a struct", .{});
return fail(p, tok, "expected paths expression to be a list of strings", .{});
};
for (array_init.ast.elements) |elem_node| {