From e6a30b07e33ec4acd089a0e58ddcf247e498da1d Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Tue, 17 Dec 2024 00:25:07 +0400 Subject: [PATCH] clone: actually reclaim unallocated bytes (#974) --- Sources/tart/Commands/Clone.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/tart/Commands/Clone.swift b/Sources/tart/Commands/Clone.swift index 164a85a..d09fae2 100644 --- a/Sources/tart/Commands/Clone.swift +++ b/Sources/tart/Commands/Clone.swift @@ -77,7 +77,7 @@ struct Clone: AsyncParsableCommand { // So, once we clone the VM let's try to claim the rest of space for the VM to run without errors. let unallocatedBytes = try sourceVM.sizeBytes() - sourceVM.allocatedSizeBytes() if unallocatedBytes > 0 { - try Prune.reclaimIfNeeded(UInt64(), sourceVM) + try Prune.reclaimIfNeeded(UInt64(unallocatedBytes), sourceVM) } }, onCancel: { try? FileManager.default.removeItem(at: tmpVMDir.baseURL)