@@ -163,25 +163,33 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(
163
163
[self performSelectorInBackground: @selector (evaluateRemoteBadge: ) withObject: remote];
164
164
}
165
165
166
- for (PBGitSVBranchItem* branch in [branches children ]){
167
- if ([branch isKindOfClass: [PBGitSVBranchItem class ]]){
168
- NSString *bName=[branch title ];
169
- dispatch_async (PBGetWorkQueue (),^{
170
- id ahead = [self countCommintsOf: [NSString stringWithFormat: @" origin/%@ ..%@ " ,bName,bName]];
171
- id behind = [self countCommintsOf: [NSString stringWithFormat: @" %@ ..origin/%@ " ,bName,bName]];
172
- dispatch_async (dispatch_get_main_queue (),^{
173
- [branch setAhead: ahead];
174
- [branch setBehind: behind];
175
- [branch setIsCheckedOut: [branch.revSpecifier isEqual: [repository headRef ]]];
176
- });
177
- });
178
- }
179
- }
166
+ [self updateMetaDataforBranches: branches];
180
167
}else {
181
168
[super observeValueForKeyPath: keyPath ofObject: object change: change context: context];
182
169
}
183
170
}
184
171
172
+
173
+ -(void )updateMetaDataforBranches : (PBSourceViewItem *)theBranches
174
+ {
175
+ for (PBGitSVBranchItem* branch in [theBranches children ]){
176
+ if ([branch isKindOfClass: [PBGitSVBranchItem class ]]){
177
+ dispatch_async (PBGetWorkQueue (),^{
178
+ id ahead = [self countCommintsOf: [NSString stringWithFormat: @" origin/%@ ..%@ " ,branch.revSpecifier,branch.revSpecifier]];
179
+ id behind = [self countCommintsOf: [NSString stringWithFormat: @" %@ ..origin/%@ " ,branch.revSpecifier,branch.revSpecifier]];
180
+ dispatch_async (dispatch_get_main_queue (),^{
181
+ [branch setAhead: ahead];
182
+ [branch setBehind: behind];
183
+ [branch setIsCheckedOut: [branch.revSpecifier isEqual: [repository headRef ]]];
184
+ });
185
+ });
186
+ }else if ([branch isKindOfClass: [PBGitSVFolderItem class ]]) {
187
+ [self updateMetaDataforBranches: branch];
188
+ }
189
+ }
190
+ }
191
+
192
+
185
193
#pragma mark Badges Methods
186
194
187
195
-(void )evaluateRemoteBadge : (PBGitSVRemoteItem *)remote
0 commit comments