mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Fix moving of refs
This was seriously broken after we moved to a hash
to store the refs in ddc9ae7654. Apparently nobody
noticed this earlier.
We fix it by doing the right thing. Don't remove the array
if it's empty, but check in the drawing if we really have refs.
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
+2
-4
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user