@@ -51,7 +51,7 @@ pub const Repository = struct {
51
51
/// Checks out the repository at `commit_oid` to `worktree`.
52
52
pub fn checkout (
53
53
repository : * Repository ,
54
- worktree : anytype ,
54
+ worktree : std.fs.Dir ,
55
55
commit_oid : Oid ,
56
56
) ! void {
57
57
try repository .odb .seekOid (commit_oid );
@@ -66,7 +66,7 @@ pub const Repository = struct {
66
66
/// Checks out the tree at `tree_oid` to `worktree`.
67
67
fn checkoutTree (
68
68
repository : * Repository ,
69
- dir : anytype ,
69
+ dir : std.fs.Dir ,
70
70
tree_oid : Oid ,
71
71
current_path : []const u8 ,
72
72
) ! void {
@@ -1460,7 +1460,7 @@ test "packfile indexing and checkout" {
1460
1460
var worktree = testing .tmpDir (.{ .iterate = true });
1461
1461
defer worktree .cleanup ();
1462
1462
1463
- try repository .checkout (worktree .dir , repo . commit_id );
1463
+ try repository .checkout (worktree .dir , try TestRepo . commitID () );
1464
1464
1465
1465
var actual_files : std .ArrayListUnmanaged ([]u8 ) = .{};
1466
1466
defer actual_files .deinit (testing .allocator );
@@ -1506,7 +1506,6 @@ pub const TestRepo = struct {
1506
1506
git_dir : testing.TmpDir ,
1507
1507
pack_file : std.fs.File ,
1508
1508
index_file : std.fs.File ,
1509
- commit_id : Oid ,
1510
1509
1511
1510
pub const expected_files : []const []const u8 = &.{
1512
1511
"dir/file" ,
@@ -1547,7 +1546,6 @@ pub const TestRepo = struct {
1547
1546
.git_dir = git_dir ,
1548
1547
.pack_file = pack_file ,
1549
1548
.index_file = index_file ,
1550
- .commit_id = try parseOid ("dd582c0720819ab7130b103635bd7271b9fd4feb" ),
1551
1549
};
1552
1550
}
1553
1551
@@ -1573,7 +1571,7 @@ test "packfile iterator" {
1573
1571
var repository = try Repository .init (testing .allocator , repo .pack_file , repo .index_file );
1574
1572
defer repository .deinit ();
1575
1573
1576
- var iter = try repository .iterator (repo . commit_id );
1574
+ var iter = try repository .iterator (try TestRepo . commitID () );
1577
1575
defer iter .deinit ();
1578
1576
1579
1577
var actual_files = std .ArrayList ([]u8 ).init (testing .allocator );
0 commit comments