Skip to content

Commit

Permalink
Fix #792 missing image comparison (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stengo authored Jan 4, 2022
1 parent 8e7fead commit 4a48219
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 4a48219

Please sign in to comment.