Skip to content

Commit

Permalink
Don't use GC'd string for static path list
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanj committed Sep 25, 2011
1 parent 8e5b696 commit b9b07f7
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions PBGitBinary.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,18 @@ + (NSString *) path;

+ (NSArray *) searchLocations
{
if (locations)
return locations;

locations = [NSMutableArray arrayWithObjects:@"/opt/local/bin/git",
@"/sw/bin/git",
@"/opt/git/bin/git",
@"/usr/local/bin/git",
@"/usr/local/git/bin/git",
nil];

[locations addObject:[@"~/bin/git" stringByExpandingTildeInPath]];
if (!locations)
{
locations = [[NSMutableArray alloc] initWithObjects:
@"/opt/local/bin/git",
@"/sw/bin/git",
@"/opt/git/bin/git",
@"/usr/local/bin/git",
@"/usr/local/git/bin/git",
nil];

[locations addObject:[@"~/bin/git" stringByExpandingTildeInPath]];
}
return locations;
}

Expand Down

0 comments on commit b9b07f7

Please sign in to comment.