authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-13 12:13:56 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-13 12:13:56 -07:00
loga24c14cfda1ec666069a91eb875addfcab2413ed
treee7ec94853534a4b6742e40a4767ebee362393c62
parent8610e2358d919445eb36f2eba18b4bb307b9202f
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

dont trim stdout on these functions


1 files changed, 10 insertions(+), 10 deletions(-)

git.zig+10-10
......@@ -271,11 +271,11 @@ pub fn getTreeDiffOnlyRaw(alloc: std.mem.Allocator, dir: nfs.Dir, commitid: Comm
271271 // result of `printf | git hash-object -t tree --stdin`
272272 const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--raw", "-r", "4b825dc642cb6eb9a060e54bf8d69288fbee4904", commitid.id });
273273 std.debug.assert(result.term == .exited and result.term.exited == 0);
274 return std.mem.trim(u8, result.stdout, "\n");
274 return result.stdout;
275275 }
276276 const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--raw", "-r", parentid.?.id, commitid.id });
277277 std.debug.assert(result.term == .exited and result.term.exited == 0);
278 return std.mem.trim(u8, result.stdout, "\n");
278 return result.stdout;
279279}
280280
281281// TODO make this inspect .git manually
......@@ -288,11 +288,11 @@ pub fn getTreeDiffOnlyStat(alloc: std.mem.Allocator, dir: nfs.Dir, commitid: Com
288288 // result of `printf | git hash-object -t tree --stdin`
289289 const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--stat", "4b825dc642cb6eb9a060e54bf8d69288fbee4904", commitid.id });
290290 std.debug.assert(result.term == .exited and result.term.exited == 0);
291 return std.mem.trim(u8, result.stdout, "\n");
291 return result.stdout;
292292 }
293293 const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--stat", parentid.?.id, commitid.id });
294294 std.debug.assert(result.term == .exited and result.term.exited == 0);
295 return std.mem.trim(u8, result.stdout, "\n");
295 return result.stdout;
296296}
297297
298298// TODO make this inspect .git manually
......@@ -305,11 +305,11 @@ pub fn getTreeDiffOnlySummary(alloc: std.mem.Allocator, dir: nfs.Dir, commitid:
305305 // result of `printf | git hash-object -t tree --stdin`
306306 const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--summary", "4b825dc642cb6eb9a060e54bf8d69288fbee4904", commitid.id });
307307 std.debug.assert(result.term == .exited and result.term.exited == 0);
308 return std.mem.trim(u8, result.stdout, "\n");
308 return result.stdout;
309309 }
310310 const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .ignore, 1024 * 1024 * 1024, &.{ "git", "diff-tree", "--summary", parentid.?.id, commitid.id });
311311 std.debug.assert(result.term == .exited and result.term.exited == 0);
312 return std.mem.trim(u8, result.stdout, "\n");
312 return result.stdout;
313313}
314314
315315// TODO make this inspect .git manually
......@@ -323,12 +323,12 @@ pub fn getTreeDiffOnlyDiff(alloc: std.mem.Allocator, dir: nfs.Dir, commitid: Com
323323 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 });
324324 if (!(result.term == .exited and result.term.exited == 0)) std.log.err("{s}", .{result.stderr});
325325 std.debug.assert(result.term == .exited and result.term.exited == 0);
326 return std.mem.trim(u8, result.stdout, "\n");
326 return result.stdout;
327327 }
328328 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 });
329329 if (!(result.term == .exited and result.term.exited == 0)) std.log.err("{s}", .{result.stderr});
330330 std.debug.assert(result.term == .exited and result.term.exited == 0);
331 return std.mem.trim(u8, result.stdout, "\n");
331 return result.stdout;
332332}
333333
334334// TODO make this inspect .git manually
......@@ -340,12 +340,12 @@ pub fn getFormatPatch(alloc: std.mem.Allocator, dir: nfs.Dir, commitid: CommitId
340340 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 });
341341 if (!(result.term == .exited and result.term.exited == 0)) std.log.err("{s}", .{result.stderr});
342342 std.debug.assert(result.term == .exited and result.term.exited == 0);
343 return std.mem.trim(u8, result.stdout, "\n");
343 return result.stdout;
344344 }
345345 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 });
346346 if (!(result.term == .exited and result.term.exited == 0)) std.log.err("{s}", .{result.stderr});
347347 std.debug.assert(result.term == .exited and result.term.exited == 0);
348 return std.mem.trim(u8, result.stdout, "\n");
348 return result.stdout;
349349}
350350
351351// TODO make this inspect .git manually