1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-21 15:44:10 +00:00

fixed pkghash

This commit is contained in:
Rene Schallner 2023-04-23 00:28:46 +02:00
parent e74cfdfc78
commit d9b3c528e9

View file

@ -196,7 +196,11 @@ pub fn cmdPkgGit(gpa: Allocator, args: []const []const u8) !void {
} }
} }
defer gpa.free(git_tag.?); errdefer {
if (git_tag) |g| {
gpa.free(g);
}
}
const hash = blk: { const hash = blk: {
const result = try gitFileList(gpa, cwd_absolute_path); const result = try gitFileList(gpa, cwd_absolute_path);
@ -222,6 +226,9 @@ pub fn cmdPkgGit(gpa: Allocator, args: []const []const u8) !void {
} else { } else {
try renderTemplate(gpa, git_tag.?, template_filn.?, digest_slice); try renderTemplate(gpa, git_tag.?, template_filn.?, digest_slice);
} }
if (git_tag) |g| {
gpa.free(g);
}
} }
fn renderTemplate(gpa: std.mem.Allocator, tag: []const u8, template: []const u8, hash: []const u8) !void { fn renderTemplate(gpa: std.mem.Allocator, tag: []const u8, template: []const u8, hash: []const u8) !void {