diff --git a/git.zig b/git.zig index 594ae62b13a9b1bcc76ec8ff64fe569211a30633..752f5c05ad77c49efafb36baf39b4eb60b48ba9f 100644 --- a/git.zig +++ b/git.zig @@ -271,11 +271,11 @@ pub fn getTreeDiffOnlyRaw(alloc: std.mem.Allocator, dir: nfs.Dir, commitid: Comm // result of `printf | git hash-object -t tree --stdin` const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--raw", "-r", "4b825dc642cb6eb9a060e54bf8d69288fbee4904", commitid.id }); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--raw", "-r", parentid.?.id, commitid.id }); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } // TODO make this inspect .git manually @@ -288,11 +288,11 @@ pub fn getTreeDiffOnlyStat(alloc: std.mem.Allocator, dir: nfs.Dir, commitid: Com // result of `printf | git hash-object -t tree --stdin` const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--stat", "4b825dc642cb6eb9a060e54bf8d69288fbee4904", commitid.id }); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--stat", parentid.?.id, commitid.id }); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } // TODO make this inspect .git manually @@ -305,11 +305,11 @@ pub fn getTreeDiffOnlySummary(alloc: std.mem.Allocator, dir: nfs.Dir, commitid: // result of `printf | git hash-object -t tree --stdin` const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--summary", "4b825dc642cb6eb9a060e54bf8d69288fbee4904", commitid.id }); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--summary", parentid.?.id, commitid.id }); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } // TODO make this inspect .git manually @@ -323,12 +323,12 @@ pub fn getTreeDiffOnlyDiff(alloc: std.mem.Allocator, dir: nfs.Dir, commitid: Com const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--patch", "--full-index", "--patience", "4b825dc642cb6eb9a060e54bf8d69288fbee4904", commitid.id }); if (!(result.term == .exited and result.term.exited == 0)) std.log.err("{s}", .{result.stderr}); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--patch", "--full-index", "--patience", parentid.?.id, commitid.id }); if (!(result.term == .exited and result.term.exited == 0)) std.log.err("{s}", .{result.stderr}); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } // TODO make this inspect .git manually @@ -340,12 +340,12 @@ pub fn getFormatPatch(alloc: std.mem.Allocator, dir: nfs.Dir, commitid: CommitId const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .pipe, 1024 * 1024 * 1024, &.{ "git", "format-patch", "--stdout", "--full-index", "--patience", "--root", commitid.id }); if (!(result.term == .exited and result.term.exited == 0)) std.log.err("{s}", .{result.stderr}); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .pipe, 1024 * 1024 * 1024, &.{ "git", "format-patch", "--stdout", "--full-index", "--patience", parentid.?.id ++ "..." ++ commitid.id }); if (!(result.term == .exited and result.term.exited == 0)) std.log.err("{s}", .{result.stderr}); std.debug.assert(result.term == .exited and result.term.exited == 0); - return std.mem.trim(u8, result.stdout, "\n"); + return result.stdout; } // TODO make this inspect .git manually