diff --git a/PBGitBinary.m b/PBGitBinary.m index 8c8c4aa..aeb6d79 100644 --- a/PBGitBinary.m +++ b/PBGitBinary.m @@ -45,14 +45,21 @@ static NSString* gitPath; return gitPath; } +static NSMutableArray *locations = nil; + + (NSArray *) searchLocations { - NSArray* locations = [NSArray arrayWithObjects:@"/opt/local/bin/git", + 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]]; return locations; }