Skip to content

Commit 1cf29da

Browse files
committed
package.git: cleanup anytype
Not used from Unpack any more.
1 parent 92b3099 commit 1cf29da

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Package/Fetch/git.zig

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub const Repository = struct {
5151
/// Checks out the repository at `commit_oid` to `worktree`.
5252
pub fn checkout(
5353
repository: *Repository,
54-
worktree: anytype,
54+
worktree: std.fs.Dir,
5555
commit_oid: Oid,
5656
) !void {
5757
try repository.odb.seekOid(commit_oid);
@@ -66,7 +66,7 @@ pub const Repository = struct {
6666
/// Checks out the tree at `tree_oid` to `worktree`.
6767
fn checkoutTree(
6868
repository: *Repository,
69-
dir: anytype,
69+
dir: std.fs.Dir,
7070
tree_oid: Oid,
7171
current_path: []const u8,
7272
) !void {
@@ -1460,7 +1460,7 @@ test "packfile indexing and checkout" {
14601460
var worktree = testing.tmpDir(.{ .iterate = true });
14611461
defer worktree.cleanup();
14621462

1463-
try repository.checkout(worktree.dir, repo.commit_id);
1463+
try repository.checkout(worktree.dir, try TestRepo.commitID());
14641464

14651465
var actual_files: std.ArrayListUnmanaged([]u8) = .{};
14661466
defer actual_files.deinit(testing.allocator);
@@ -1506,7 +1506,6 @@ pub const TestRepo = struct {
15061506
git_dir: testing.TmpDir,
15071507
pack_file: std.fs.File,
15081508
index_file: std.fs.File,
1509-
commit_id: Oid,
15101509

15111510
pub const expected_files: []const []const u8 = &.{
15121511
"dir/file",
@@ -1547,7 +1546,6 @@ pub const TestRepo = struct {
15471546
.git_dir = git_dir,
15481547
.pack_file = pack_file,
15491548
.index_file = index_file,
1550-
.commit_id = try parseOid("dd582c0720819ab7130b103635bd7271b9fd4feb"),
15511549
};
15521550
}
15531551

@@ -1573,7 +1571,7 @@ test "packfile iterator" {
15731571
var repository = try Repository.init(testing.allocator, repo.pack_file, repo.index_file);
15741572
defer repository.deinit();
15751573

1576-
var iter = try repository.iterator(repo.commit_id);
1574+
var iter = try repository.iterator(try TestRepo.commitID());
15771575
defer iter.deinit();
15781576

15791577
var actual_files = std.ArrayList([]u8).init(testing.allocator);

0 commit comments

Comments
 (0)