From df4919e65aef4364e714ccb38177717186f5917f Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Tue, 25 Apr 2023 23:21:42 -0700 Subject: [PATCH] trim trailing newline from getObject output --- git.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git.zig b/git.zig index ba168662533a983a84549e3ecc771cf40746c0a1..10b61ecc4dfe188290148710b3d1eafcec3e8ac7 100644 --- a/git.zig +++ b/git.zig @@ -29,7 +29,7 @@ pub fn getObject(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !string { .cwd_dir = dir, .argv = &.{ "git", "cat-file", "-p", obj }, }); - return result.stdout; + return std.mem.trimRight(u8, result.stdout, "\n"); } pub fn parseCommit(alloc: std.mem.Allocator, commitfile: string) !Commit { -- 2.54.0