CommitView: Don't keep rearranging when iterating over files
[GitX.git] / PBGitRef.m
blobf345a0a7a1c876d0dec33aa8c326597f51364820
1 //
2 //  PBGitRef.m
3 //  GitX
4 //
5 //  Created by Pieter de Bie on 06-09-08.
6 //  Copyright 2008 __MyCompanyName__. All rights reserved.
7 //
9 #import "PBGitRef.h"
12 @implementation PBGitRef
14 @synthesize ref;
15 - (NSString*) shortName
17         if ([self type])
18                 return [ref substringFromIndex:[[self type] length] + 7];
19         return ref;
22 - (NSString*) type
24         if ([ref hasPrefix:@"refs/heads"])
25                 return @"head";
26         if ([ref hasPrefix:@"refs/tags"])
27                 return @"tag";
28         if ([ref hasPrefix:@"refs/remotes"])
29                 return @"remote";
30         return nil;
33 + (PBGitRef*) refFromString: (NSString*) s
35         return [[PBGitRef alloc] initWithString:s];
38 - (PBGitRef*) initWithString: (NSString*) s
40         ref = s;
41         return self;
44 + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
46         return NO;
49 + (BOOL)isKeyExcludedFromWebScript:(const char *)name {
50         return NO;
53 @end