mirror of
https://github.com/samsonjs/arq_restore.git
synced 2026-03-25 09:25:53 +00:00
if the root Tree has only 1 node, named '.', set the nodeName property so that we correctly restore that single-file tree
This commit is contained in:
parent
f45caa607d
commit
de70f21d91
1 changed files with 9 additions and 0 deletions
|
|
@ -520,6 +520,15 @@
|
|||
nodeName = component;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Tree *rootTree = [repo treeForBlobKey:[commit treeBlobKey] error:error];
|
||||
if (rootTree == nil) {
|
||||
return NO;
|
||||
}
|
||||
if ([[rootTree childNodeNames] isEqualToArray:[NSArray arrayWithObject:@"."]]) {
|
||||
// Single-file case.
|
||||
nodeName = [[commit location] lastPathComponent];
|
||||
}
|
||||
}
|
||||
|
||||
NSString *restoreFileName = [args count] == 6 ? [[args objectAtIndex:5] lastPathComponent] : [[matchingBucket localPath] lastPathComponent];
|
||||
|
|
|
|||
Loading…
Reference in a new issue