Skip to content

Commit

Permalink
Extend PBGitRevSPecifier
Browse files Browse the repository at this point in the history
This makes the description more useful and adds a
path limiter function
  • Loading branch information
pieter committed Sep 12, 2008
1 parent e3af731 commit fc88117
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions PBGitRevSpecifier.h
Expand Up @@ -19,6 +19,7 @@

- (BOOL) isSimpleRef;
- (NSString*) simpleRef;
- (BOOL) hasPathLimiter;

@property(readonly) NSString* description;
@property(readonly) NSArray* parameters;
Expand Down
17 changes: 16 additions & 1 deletion PBGitRevSpecifier.m
Expand Up @@ -11,7 +11,7 @@

@implementation PBGitRevSpecifier

@synthesize description, parameters;
@synthesize parameters;

- (id) initWithParameters:(NSArray*) params
{
Expand Down Expand Up @@ -39,4 +39,19 @@ - (NSString*) simpleRef
return [parameters objectAtIndex:0];
}

- (NSString*) description
{
if (description)
return description;

return [parameters componentsJoinedByString:@" "];
}

- (BOOL) hasPathLimiter;
{
for (NSString* param in parameters)
if ([param isEqualToString:@"--"])
return YES;
return NO;
}
@end

0 comments on commit fc88117

Please sign in to comment.