Skip to content

Commit

Permalink
Fix git-up#792 missing image comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Stengo committed Dec 17, 2021
1 parent 8e7fead commit 6cf075e
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions GitUpKit/Interface/GIImageDiffView.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,17 @@ - (void)updateCurrentImage {
if (![[NSFileManager defaultManager] fileExistsAtPath:newPath]) {
[self.repository exportBlobWithSHA1:_delta.newFile.SHA1 toPath:newPath error:&error];
}
} else if (_delta.canonicalPath && _delta.oldFile.SHA1 == nil) {
} else {
newPath = [self.repository absolutePathForFile:_delta.canonicalPath];
}
if (newPath) {
_currentImageSize = [self imageSizeWithoutLoadingFromPath:newPath];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSImage* limitedSizeImage = [self generateLimitedSizeImageFromPath:newPath];
dispatch_async(dispatch_get_main_queue(), ^{
_currentImageView.image = limitedSizeImage;
[self setNeedsDisplay:true];
});
_currentImageSize = [self imageSizeWithoutLoadingFromPath:newPath];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSImage* limitedSizeImage = [self generateLimitedSizeImageFromPath:newPath];
dispatch_async(dispatch_get_main_queue(), ^{
_currentImageView.image = limitedSizeImage;
[self setNeedsDisplay:true];
});
} else {
_currentImageView.image = nil;
}
});
}

- (void)updateOldImage {
Expand Down

0 comments on commit 6cf075e

Please sign in to comment.