From 4a482191b3426e0f74013ab94341df37148973ad Mon Sep 17 00:00:00 2001 From: Bastian Andelefski Date: Tue, 4 Jan 2022 16:31:51 +0100 Subject: [PATCH] Fix #792 missing image comparison (#795) --- GitUpKit/Interface/GIImageDiffView.m | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/GitUpKit/Interface/GIImageDiffView.m b/GitUpKit/Interface/GIImageDiffView.m index 9ec2c87f..29723602 100644 --- a/GitUpKit/Interface/GIImageDiffView.m +++ b/GitUpKit/Interface/GIImageDiffView.m @@ -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 {