Skip to content

Commit b9b07f7

Browse files
committed
Don't use GC'd string for static path list
brotherbard#5
1 parent 8e5b696 commit b9b07f7

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

PBGitBinary.m

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,18 @@ + (NSString *) path;
9292

9393
+ (NSArray *) searchLocations
9494
{
95-
if (locations)
96-
return locations;
97-
98-
locations = [NSMutableArray arrayWithObjects:@"/opt/local/bin/git",
99-
@"/sw/bin/git",
100-
@"/opt/git/bin/git",
101-
@"/usr/local/bin/git",
102-
@"/usr/local/git/bin/git",
103-
nil];
104-
105-
[locations addObject:[@"~/bin/git" stringByExpandingTildeInPath]];
95+
if (!locations)
96+
{
97+
locations = [[NSMutableArray alloc] initWithObjects:
98+
@"/opt/local/bin/git",
99+
@"/sw/bin/git",
100+
@"/opt/git/bin/git",
101+
@"/usr/local/bin/git",
102+
@"/usr/local/git/bin/git",
103+
nil];
104+
105+
[locations addObject:[@"~/bin/git" stringByExpandingTildeInPath]];
106+
}
106107
return locations;
107108
}
108109

0 commit comments

Comments
 (0)