diff --git a/ArqRestoreCommand.m b/ArqRestoreCommand.m index e4b5494..27ed627 100644 --- a/ArqRestoreCommand.m +++ b/ArqRestoreCommand.m @@ -520,6 +520,15 @@ - (BOOL)restore:(NSArray *)args error:(NSError **)error { 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];