History view not updated
After several operations, the history view is not updated properly, so it does not reflect the current state of the repository. In that case Cmd+R has to be pressed. This is at least the case for Fetch and Rebase. For both cases, the keyboard command can be emulated by calling the main refresh method. However, this actually refreshes more than it is necessary, e.g. the lower right pane.
As a workaround, I implemented the following. I added a call to refresh at most places where also reloadRefs is called:
---
PBGitHistoryController.m | 1 +
PBGitRepository.m | 8 ++++++++
PBGitSidebarController.m | 1 +
PBRemoteProgressSheet.m | 6 ++++--
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m
index a8bf5ac..ccfa7c1 100644
--- a/PBGitHistoryController.m
+++ b/PBGitHistoryController.m
@@ -66,6 +66,7 @@
if (!repository.currentBranch) {
[repository reloadRefs];
[repository readCurrentBranch];
+ [superController refresh:self];
}
else
[repository lazyReload];
diff --git a/PBGitRepository.m b/PBGitRepository.m
index 3d4489b..8d67dd9 100644
--- a/PBGitRepository.m
+++ b/PBGitRepository.m
@@ -685,6 +685,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
[self reloadRefs];
[self readCurrentBranch];
+ [self.windowController refresh:self];
return YES;
}
@@ -729,6 +730,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
[self reloadRefs];
[self readCurrentBranch];
+ [self.windowController refresh:self];
return YES;
}
@@ -750,6 +752,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
[self reloadRefs];
[self readCurrentBranch];
+ [self.windowController refresh:self];
return YES;
}
@@ -776,6 +779,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
[self reloadRefs];
[self readCurrentBranch];
+ [self.windowController refresh:self];
return YES;
}
@@ -794,6 +798,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
}
[self reloadRefs];
+ [self.windowController refresh:self];
return YES;
}
@@ -828,6 +833,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
}
[self reloadRefs];
+ [self.windowController refresh:self];
return YES;
}
@@ -857,6 +863,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
}
[self reloadRefs];
+ [self.windowController refresh:self];
return YES;
}
@@ -882,6 +889,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
[commit removeRef:ref];
[self reloadRefs];
+ [self.windowController refresh:self];
return YES;
}
diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m
index efcf6f1..8fdc84e 100644
--- a/PBGitSidebarController.m
+++ b/PBGitSidebarController.m
@@ -121,6 +121,7 @@
if (!rev) {
[repository reloadRefs];
[repository readCurrentBranch];
+ [superController refresh:self];
return;
}
diff --git a/PBRemoteProgressSheet.m b/PBRemoteProgressSheet.m
index 0160431..81545df 100644
--- a/PBRemoteProgressSheet.m
+++ b/PBRemoteProgressSheet.m
@@ -119,8 +119,10 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo";
else
[self showSuccessMessage];
- if ([controller respondsToSelector:@selector(repository)])
- [[(PBGitWindowController *)controller repository] reloadRefs];
+ if ([controller respondsToSelector:@selector(repository)]) {
+ [[(PBGitWindowController *)controller repository] reloadRefs];
+ [(PBGitWindowController *)controller refresh:self];
+ }
}
--