From 5724739b519761e8a7898fd174c08ab020de37cf Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 4 Aug 2025 09:23:52 +0200 Subject: [PATCH] fix: don't log blank lines output by git to stderr --- src/git.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/git.zig b/src/git.zig index 714ba86..1bf696d 100644 --- a/src/git.zig +++ b/src/git.zig @@ -168,7 +168,8 @@ pub fn status(context_: usize) Error!void { }.result, struct { fn result(_: usize, _: tp.pid_ref, output: []const u8) void { var it = std.mem.splitScalar(u8, output, '\n'); - while (it.next()) |line| std.log.err("{s}: {s}", .{ module_name, line }); + while (it.next()) |line| if (line.len > 0) + std.log.err("{s}: {s}", .{ module_name, line }); } }.result, exit_null(tag)); } @@ -183,7 +184,8 @@ fn git_line_output(context_: usize, comptime tag: []const u8, cmd: anytype) Erro }.result, struct { fn result(_: usize, _: tp.pid_ref, output: []const u8) void { var it = std.mem.splitScalar(u8, output, '\n'); - while (it.next()) |line| std.log.err("{s}: {s}", .{ module_name, line }); + while (it.next()) |line| if (line.len > 0) + std.log.err("{s}: {s}", .{ module_name, line }); } }.result, exit_null(tag)); }