Permalink
Browse files

Extend PBGitRevSPecifier

This makes the description more useful and adds a
path limiter function
  • Loading branch information...
pieter committed Sep 12, 2008
1 parent e3af731 commit fc881176591e993f29585bc53db394bd0690bdde
Showing with 17 additions and 1 deletion.
  1. +1 −0 PBGitRevSpecifier.h
  2. +16 −1 PBGitRevSpecifier.m
View
@@ -19,6 +19,7 @@
- (BOOL) isSimpleRef;
- (NSString*) simpleRef;
+- (BOOL) hasPathLimiter;
@property(readonly) NSString* description;
@property(readonly) NSArray* parameters;
View
@@ -11,7 +11,7 @@
@implementation PBGitRevSpecifier
-@synthesize description, parameters;
+@synthesize parameters;
- (id) initWithParameters:(NSArray*) params
{
@@ -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.