authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-06-21 18:53:52 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-06-21 18:53:52 -07:00
log12a2aa9ae3b958fc59f19271a4cfdd947158e4cc
tree635fb23280e2e0d766e9f5faa20cd5569b5355c8
parentb206fa9978ef2cc06bab4d307c7ed07f1f3b88af

diff state lines are actually blob ids


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

git.zig+5-5
...@@ -517,8 +517,8 @@ pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff {...@@ -517,8 +517,8 @@ pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff {
517 const before_mode = try parseTreeMode(jter.next().?);517 const before_mode = try parseTreeMode(jter.next().?);
518 const after_mode = try parseTreeMode(jter.next().?);518 const after_mode = try parseTreeMode(jter.next().?);
519519
520 const before_tree = ensureObjId(TreeId, jter.next().?);520 const before_tree = ensureObjId(BlobId, jter.next().?);
521 const after_tree = ensureObjId(TreeId, jter.next().?);521 const after_tree = ensureObjId(BlobId, jter.next().?);
522522
523 var kter = std.mem.splitScalar(u8, jter.next().?, '\t'); // why is there a tab here git. why?523 var kter = std.mem.splitScalar(u8, jter.next().?, '\t'); // why is there a tab here git. why?
524 const action_s = kter.next().?;524 const action_s = kter.next().?;
...@@ -526,11 +526,11 @@ pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff {...@@ -526,11 +526,11 @@ pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff {
526 try overview.append(.{526 try overview.append(.{
527 .before = .{527 .before = .{
528 .mode = before_mode,528 .mode = before_mode,
529 .tree = before_tree,529 .blob = before_tree,
530 },530 },
531 .after = .{531 .after = .{
532 .mode = after_mode,532 .mode = after_mode,
533 .tree = after_tree,533 .blob = after_tree,
534 },534 },
535 .action = std.meta.stringToEnum(TreeDiff.Action, action_s).?,535 .action = std.meta.stringToEnum(TreeDiff.Action, action_s).?,
536 .sub_path = kter.rest(),536 .sub_path = kter.rest(),
...@@ -642,7 +642,7 @@ pub const TreeDiff = struct {...@@ -642,7 +642,7 @@ pub const TreeDiff = struct {
642642
643 pub const State = struct {643 pub const State = struct {
644 mode: Tree.Object.Mode,644 mode: Tree.Object.Mode,
645 tree: TreeId,645 blob: BlobId,
646 };646 };
647647
648 pub const Action = enum {648 pub const Action = enum {