Skip to content

Commit 75b2691

Browse files
committed
finishedGraphing wasn't getting called when updateHistoryForRev:
This resulted in the progress indicator getting stuck on when viewing a stash.
1 parent 1aef490 commit 75b2691

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

Classes/git/PBGitHistoryList.m

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,14 @@ - (void) updateProjectHistoryForRev:(PBGitRevSpecifier *)rev
318318
lastRemoteRef = nil;
319319
lastOID = nil;
320320
self.commits = [NSMutableArray array];
321-
[projectRevList loadRevisons];
322-
return;
321+
[projectRevList loadRevisonsWithCompletionBlock:^{
322+
dispatch_async(dispatch_get_main_queue(), ^{
323+
[self finishedGraphing];
324+
});
325+
}];
326+
} else {
327+
[graphQueue addOperation:[self operationForCommits:projectRevList.commits]];
323328
}
324-
325-
[graphQueue addOperation:[self operationForCommits:projectRevList.commits]];
326329
}
327330

328331

@@ -337,7 +340,11 @@ - (void) updateHistoryForRev:(PBGitRevSpecifier *)rev
337340
lastOID = nil;
338341
self.commits = [NSMutableArray array];
339342

340-
[otherRevListParser loadRevisons];
343+
[otherRevListParser loadRevisonsWithCompletionBlock:^{
344+
dispatch_async(dispatch_get_main_queue(), ^{
345+
[self finishedGraphing];
346+
});
347+
}];
341348
}
342349

343350

Classes/git/PBGitRevList.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@property (nonatomic, strong) NSMutableArray<PBGitCommit *> *commits;
1919

2020
- (id) initWithRepository:(PBGitRepository *)repo rev:(PBGitRevSpecifier *)rev shouldGraph:(BOOL)graph;
21-
- (void) loadRevisons;
21+
- (void)loadRevisonsWithCompletionBlock:(void(^)(void))completionBlock;
2222
- (void)cancel;
2323

2424
@end

Classes/git/PBGitRevList.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ - (id) initWithRepository:(PBGitRepository *)repo rev:(PBGitRevSpecifier *)rev s
6262
return self;
6363
}
6464

65-
- (void) loadRevisons
65+
- (void)loadRevisonsWithCompletionBlock:(void(^)(void))completionBlock
6666
{
6767
[self cancel];
6868

@@ -83,6 +83,7 @@ - (void) loadRevisons
8383
[weakSelf setupEnumerator:enu forRevspec:weakSelf.currentRev];
8484
[weakSelf addCommitsFromEnumerator:enu inPBRepo:pbRepo operation:weakParseOperation];
8585
}];
86+
[parseOperation setCompletionBlock:completionBlock];
8687

8788
[self.operationQueue addOperation:parseOperation];
8889
}

0 commit comments

Comments
 (0)