From 79a184aa4a28edc7cacce8f94239c1b71b3f371c Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 15 Dec 2025 23:25:33 +0100 Subject: [PATCH] refactor: fix error handling in git.rev_parse --- src/git.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git.zig b/src/git.zig index fa01ea4..790f4ac 100644 --- a/src/git.zig +++ b/src/git.zig @@ -273,9 +273,9 @@ pub fn rev_parse(context_: usize, rev: []const u8, file_path: []const u8) Error! var arg: std.Io.Writer.Allocating = .init(allocator); defer arg.deinit(); if (file_path.len == 0) - arg.writer.print("{s}", .{rev}) + try arg.writer.print("{s}", .{rev}) else - arg.writer.print("{s}:{s}", .{ rev, file_path }); + try arg.writer.print("{s}:{s}", .{ rev, file_path }); try git(context_, .{ "rev-parse", arg.written() }, struct { fn result(context: usize, parent: tp.pid_ref, output: []const u8) void { var it = std.mem.splitScalar(u8, output, '\n');