Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove static array in -remoteBranchesWithError: #79

Merged
merged 1 commit into from

2 participants

Justin Spahr-Summers Josh Abernathy
Justin Spahr-Summers

It's not necessary to use an array at all, but especially a static one. Got some weird crash dealing with the static array having been released, and it's just not worth it.

Justin Spahr-Summers jspahrsummers Remove static array in -remoteBranchesWithError:
It's not necessary to use an array at all, but especially a static one. Got some weird crash dealing with the static array having been released, and it's just not worth it.
a818f96
Josh Abernathy
Owner

I don't like the idea of playing whack-a-mole but since it really doesn't seem necessary...

Josh Abernathy joshaber merged commit 561b028 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 9, 2012
  1. Justin Spahr-Summers

    Remove static array in -remoteBranchesWithError:

    jspahrsummers authored
    It's not necessary to use an array at all, but especially a static one. Got some weird crash dealing with the static array having been released, and it's just not worth it.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 6 deletions.
  1. +1 −6 Classes/GTRepository.m
7 Classes/GTRepository.m
View
@@ -346,17 +346,12 @@ - (NSArray *)localBranchesWithError:(NSError **)error {
}
- (NSArray *)remoteBranchesWithError:(NSError **)error {
- static NSArray *unwantedRemoteBranches = nil;
- if(unwantedRemoteBranches == nil) {
- unwantedRemoteBranches = [NSArray arrayWithObjects:@"HEAD", nil];
- }
-
NSArray *remoteBranches = [self branchesWithPrefix:[GTBranch remoteNamePrefix] error:error];
if(remoteBranches == nil) return nil;
NSMutableArray *filteredList = [NSMutableArray arrayWithCapacity:remoteBranches.count];
for(GTBranch *branch in remoteBranches) {
- if(![unwantedRemoteBranches containsObject:branch.shortName]) {
+ if(![branch.shortName isEqualToString:@"HEAD"]) {
[filteredList addObject:branch];
}
}
Something went wrong with that request. Please try again.