mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Merge pull request #514 from zorgiepoo/binary-delta-dir-change-issue
Fix BinaryDelta sometimes failing when a dir becomes a dir link
This commit is contained in:
commit
3b8513546e
1 file changed
+15
-2
Vendored
+15
-2
@@ -206,10 +206,23 @@ int main(int __unused argc, char __unused *argv[])
|
||||
NSDictionary *info = infoForFile(ent);
|
||||
NSDictionary *oldInfo = originalTreeState[key];
|
||||
|
||||
if ([info isEqual:oldInfo])
|
||||
if ([info isEqual:oldInfo]) {
|
||||
[newTreeState removeObjectForKey:key];
|
||||
else
|
||||
} else {
|
||||
newTreeState[key] = info;
|
||||
|
||||
if (oldInfo && [oldInfo[@"type"] unsignedShortValue] == FTS_D && [info[@"type"] unsignedShortValue] != FTS_D) {
|
||||
NSArray *parentPathComponents = key.pathComponents;
|
||||
|
||||
for (NSString *childPath in originalTreeState) {
|
||||
NSArray *childPathComponents = childPath.pathComponents;
|
||||
if (childPathComponents.count > parentPathComponents.count &&
|
||||
[parentPathComponents isEqualToArray:[childPathComponents subarrayWithRange:NSMakeRange(0, parentPathComponents.count)]]) {
|
||||
[newTreeState removeObjectForKey:childPath];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fts_close(fts);
|
||||
|
||||
|
||||
Reference in new issue
Block a user