GitRepository: Add an "all branches" option in branches list

This is probably the most common non-branch GitX option, so
let's add it by default
This commit is contained in:
Pieter de Bie
2008-10-03 19:25:50 +02:00
parent bae7566cde
commit ffae6a8564
3 changed files with 15 additions and 2 deletions
+3
View File
@@ -231,6 +231,9 @@ static NSString* gitPath;
}
self.refs = refs;
// Add an "All branches" option in the branches list
[self addBranch:[PBGitRevSpecifier allBranchesRevSpec]];
return ret;
}
+4 -1
View File
@@ -23,6 +23,9 @@
- (BOOL) hasLeftRight;
- (BOOL) isEqualTo: (PBGitRevSpecifier*) other;
@property(readonly) NSString* description;
+ (PBGitRevSpecifier *)allBranchesRevSpec;
@property(copy) NSString* description;
@property(readonly) NSArray* parameters;
@end
+8 -1
View File
@@ -11,7 +11,7 @@
@implementation PBGitRevSpecifier
@synthesize parameters;
@synthesize parameters, description;
- (id) initWithParameters:(NSArray*) params
{
@@ -27,6 +27,13 @@
return self;
}
+ (PBGitRevSpecifier *)allBranchesRevSpec
{
id revspec = [[PBGitRevSpecifier alloc] initWithParameters:[NSArray arrayWithObject:@"--all"]];
[revspec setDescription:@"All branches"];
return revspec;
}
- (BOOL) isSimpleRef
{
return ([parameters count] == 1 && ![[parameters objectAtIndex:0] hasPrefix:@"-"]);