| ... | @@ -28,7 +28,7 @@ test { | ... | @@ -28,7 +28,7 @@ test { |
| 28 | const alloc = arena.allocator(); | 28 | const alloc = arena.allocator(); |
| 29 | const git_dir = try nfs.cwd().openDir(".git", .{}); | 29 | const git_dir = try nfs.cwd().openDir(".git", .{}); |
| 30 | defer git_dir.close(); | 30 | defer git_dir.close(); |
| 31 | try expect(try git.getObject(alloc, git_dir, "a542da41f1f0c59fdd0e1527cf5ff9de3f6a0c8e")).toEqualString( | 31 | try expect(try git.getObjectContent(alloc, git_dir, "a542da41f1f0c59fdd0e1527cf5ff9de3f6a0c8e")).toEqualString( |
| 32 | \\tree 5403fecad0fde9120535321f222a061abc2849d9 | 32 | \\tree 5403fecad0fde9120535321f222a061abc2849d9 |
| 33 | \\parent c39f57f6bb01664a7146ddbfc3debe76ec135f44 | 33 | \\parent c39f57f6bb01664a7146ddbfc3debe76ec135f44 |
| 34 | \\author Meghan Denny <hello@nektro.net> 1692246864 -0700 | 34 | \\author Meghan Denny <hello@nektro.net> 1692246864 -0700 |
| ... | @@ -76,7 +76,7 @@ test { | ... | @@ -76,7 +76,7 @@ test { |
| 76 | const alloc = arena.allocator(); | 76 | const alloc = arena.allocator(); |
| 77 | const git_dir = try nfs.cwd().openDir(".git", .{}); | 77 | const git_dir = try nfs.cwd().openDir(".git", .{}); |
| 78 | defer git_dir.close(); | 78 | defer git_dir.close(); |
| 79 | const c = try git.parseCommit(alloc, try git.getObject(alloc, git_dir, "a542da41f1f0c59fdd0e1527cf5ff9de3f6a0c8e")); | 79 | const c = try git.parseCommit(alloc, try git.getObjectContent(alloc, git_dir, "a542da41f1f0c59fdd0e1527cf5ff9de3f6a0c8e")); |
| 80 | try expect(c.tree.id).toEqualString("5403fecad0fde9120535321f222a061abc2849d9"); | 80 | try expect(c.tree.id).toEqualString("5403fecad0fde9120535321f222a061abc2849d9"); |
| 81 | try expect(c.parents.len).toEqual(1); | 81 | try expect(c.parents.len).toEqual(1); |
| 82 | try expect(c.parents[0].id).toEqualString("c39f57f6bb01664a7146ddbfc3debe76ec135f44"); | 82 | try expect(c.parents[0].id).toEqualString("c39f57f6bb01664a7146ddbfc3debe76ec135f44"); |
| ... | @@ -98,7 +98,7 @@ test { | ... | @@ -98,7 +98,7 @@ test { |
| 98 | const alloc = arena.allocator(); | 98 | const alloc = arena.allocator(); |
| 99 | const git_dir = try nfs.cwd().openDir(".git", .{}); | 99 | const git_dir = try nfs.cwd().openDir(".git", .{}); |
| 100 | defer git_dir.close(); | 100 | defer git_dir.close(); |
| 101 | try expect(try git.getObject(alloc, git_dir, "5403fecad0fde9120535321f222a061abc2849d9")).toEqualString( | 101 | try expect(try git.getObjectContent(alloc, git_dir, "5403fecad0fde9120535321f222a061abc2849d9")).toEqualString( |
| 102 | // zig fmt: off | 102 | // zig fmt: off |
| 103 | "100644 blob 8e8d2ceba4b327ce9db93f988492d0e21a461012\t.gitattributes\n" ++ | 103 | "100644 blob 8e8d2ceba4b327ce9db93f988492d0e21a461012\t.gitattributes\n" ++ |
| 104 | "100644 blob bb2a57bd81d13975f2a74ae5dd0e652de07bb8a7\t.gitignore\n" ++ | 104 | "100644 blob bb2a57bd81d13975f2a74ae5dd0e652de07bb8a7\t.gitignore\n" ++ |
| ... | @@ -116,7 +116,7 @@ test { | ... | @@ -116,7 +116,7 @@ test { |
| 116 | const alloc = arena.allocator(); | 116 | const alloc = arena.allocator(); |
| 117 | const git_dir = try nfs.cwd().openDir(".git", .{}); | 117 | const git_dir = try nfs.cwd().openDir(".git", .{}); |
| 118 | defer git_dir.close(); | 118 | defer git_dir.close(); |
| 119 | const t = try git.parseTree(alloc, try git.getObject(alloc, git_dir, "5403fecad0fde9120535321f222a061abc2849d9")); | 119 | const t = try git.parseTree(alloc, try git.getObjectContent(alloc, git_dir, "5403fecad0fde9120535321f222a061abc2849d9")); |
| 120 | // TODO: test fields when we upgrade to 0.14 and have decl literals | 120 | // TODO: test fields when we upgrade to 0.14 and have decl literals |
| 121 | // try expect(try extras.mapBy(alloc, t.children, .id)).toEqualSlice(&.{ | 121 | // try expect(try extras.mapBy(alloc, t.children, .id)).toEqualSlice(&.{ |
| 122 | // .{ .blob = .{ .id = "8e8d2ceba4b327ce9db93f988492d0e21a461012" } }, | 122 | // .{ .blob = .{ .id = "8e8d2ceba4b327ce9db93f988492d0e21a461012" } }, |