Fix binary delta testFileSystemCompression failing on macOS 27 (#2904)

This commit is contained in:
Zorg authored and GitHub committed 2026-08-27 21:21:04 -07:00
1 parent 180b46555d
commit cb2c83e200
2 files changed
+9 -3

No files matched your search

+8 -2
View File
@@ -450,10 +450,16 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
fprintf(stderr, "\nApplying file system compression...");
}
NSTask *dittoTask = [[NSTask alloc] init];
NSMutableArray<NSString *> *dittoArguments = [@[@"--hfsCompression"] mutableCopy];
if (@available(macOS 27, *)) {
// Compression won't be applied on macOS 27 without passing --noclone
[dittoArguments addObject:@"--noclone"];
}
[dittoArguments addObjectsFromArray:@[destination, finalDestination]];
NSTask *dittoTask = [[NSTask alloc] init];
dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO];
dittoTask.arguments = @[@"--hfsCompression", destination, finalDestination];
dittoTask.arguments = [dittoArguments copy];
// If we fail to apply file system compression, we will try falling back to not doing this
BOOL failedToApplyFileSystemCompression = NO;
+1 -1
View File
@@ -1377,7 +1377,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
NSTask *dittoTask = [[NSTask alloc] init];
dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO];
dittoTask.arguments = @[@"--hfsCompression", destinationFile, destinationFile2];
dittoTask.arguments = @[@"--hfsCompression", @"--noclone", destinationFile, destinationFile2];
NSError *launchError = nil;
BOOL launched = [dittoTask launchAndReturnError:&launchError];