Skip to content

Commit

Permalink
Fixed crash when changing branches on 10.12
Browse files Browse the repository at this point in the history
  • Loading branch information
swisspol committed Sep 1, 2016
1 parent 66fd3c1 commit 16d3848
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions GitUp/Application/Document.m
Original file line number Diff line number Diff line change
Expand Up @@ -1524,19 +1524,18 @@ - (void)mapViewControllerDidReloadGraph:(GIMapViewController*)controller {
}

id headBranch = _repository.history.HEADBranch;
if (_lastHEADBranch) {
if (![headBranch isEqualToBranch:_lastHEADBranch]) {
if (!_helpHEADDisabled) {
if ([headBranch isKindOfClass:[GCHistoryLocalBranch class]]) {
[_windowController showOverlayWithStyle:kGIOverlayStyle_Informational format:NSLocalizedString(@"You are now on branch \"%@\"", nil), [headBranch name]];
} else if ((headBranch != [NSNull null]) && (_lastHEADBranch != [NSNull null])) {
[_windowController showOverlayWithStyle:kGIOverlayStyle_Informational message:NSLocalizedString(@"You are not on any branch anymore", nil)];
}
if (headBranch == nil) {
headBranch = [NSNull null];
}
if (![_lastHEADBranch isEqual:headBranch]) {
if (!_helpHEADDisabled) {
if ([headBranch isKindOfClass:[GCHistoryLocalBranch class]]) {
[_windowController showOverlayWithStyle:kGIOverlayStyle_Informational format:NSLocalizedString(@"You are now on branch \"%@\"", nil), [headBranch name]];
} else if (headBranch == [NSNull null]) {
[_windowController showOverlayWithStyle:kGIOverlayStyle_Informational message:NSLocalizedString(@"You are not on any branch anymore", nil)];
}
_lastHEADBranch = headBranch ? headBranch : [NSNull null];
}
} else {
_lastHEADBranch = headBranch ? headBranch : [NSNull null];
_lastHEADBranch = headBranch;
}
}

Expand Down

0 comments on commit 16d3848

Please sign in to comment.