-
Notifications
You must be signed in to change notification settings - Fork 601
/
PBGitRef.m
53 lines (43 loc) · 836 Bytes
/
PBGitRef.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// PBGitRef.m
// GitX
//
// Created by Pieter de Bie on 06-09-08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "PBGitRef.h"
@implementation PBGitRef
@synthesize ref;
- (NSString*) shortName
{
if ([self type])
return [ref substringFromIndex:[[self type] length] + 7];
return ref;
}
- (NSString*) type
{
if ([ref hasPrefix:@"refs/heads"])
return @"head";
if ([ref hasPrefix:@"refs/tags"])
return @"tag";
if ([ref hasPrefix:@"refs/remotes"])
return @"remote";
return nil;
}
+ (PBGitRef*) refFromString: (NSString*) s
{
return [[PBGitRef alloc] initWithString:s];
}
- (PBGitRef*) initWithString: (NSString*) s
{
ref = s;
return self;
}
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
{
return NO;
}
+ (BOOL)isKeyExcludedFromWebScript:(const char *)name {
return NO;
}
@end