diff --git a/PBGitCommit.h b/PBGitCommit.h index 70a6001..9a7832e 100644 --- a/PBGitCommit.h +++ b/PBGitCommit.h @@ -30,7 +30,7 @@ - initWithRepository:(PBGitRepository *)repo andSha:(git_oid)sha; -- (void)addRef:(id)ref; +- (void)addRef:(PBGitRef *)ref; - (void)removeRef:(id)ref; - (NSString *)realSha; diff --git a/PBGitCommit.m b/PBGitCommit.m index 37dc312..dbfdbdf 100644 --- a/PBGitCommit.m +++ b/PBGitCommit.m @@ -94,7 +94,7 @@ return [PBGitTree rootForCommit: self]; } -- (void)addRef:(id)ref +- (void)addRef:(PBGitRef *)ref { if (!self.refs) self.refs = [NSMutableArray arrayWithObject:ref]; @@ -108,8 +108,6 @@ return; [self.refs removeObject:ref]; - if ([self.refs count] == 0) - self.refs = NULL; } - (NSMutableArray *)refs @@ -119,7 +117,7 @@ - (void) setRefs:(NSMutableArray *)refs { - [[repository refs] setObject:[self realSha] forKey:[self realSha]]; + [[repository refs] setObject:refs forKey:[self realSha]]; } - (void)finalize diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 83bf906..7d0d079 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -229,7 +229,7 @@ } - if ([self.objectValue refs]) + if ([self.objectValue refs] && [[self.objectValue refs] count]) [self drawRefsInRect:&rect]; // Still use this superclass because of hilighting differences