mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Extend PBGitRevSPecifier
This makes the description more useful and adds a path limiter function
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
- (BOOL) isSimpleRef;
|
||||
- (NSString*) simpleRef;
|
||||
- (BOOL) hasPathLimiter;
|
||||
|
||||
@property(readonly) NSString* description;
|
||||
@property(readonly) NSArray* parameters;
|
||||
|
||||
+16
-1
@@ -11,7 +11,7 @@
|
||||
|
||||
@implementation PBGitRevSpecifier
|
||||
|
||||
@synthesize description, parameters;
|
||||
@synthesize parameters;
|
||||
|
||||
- (id) initWithParameters:(NSArray*) params
|
||||
{
|
||||
@@ -39,4 +39,19 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user