Permalink
Newer
Older
100644 54 lines (43 sloc) 836 Bytes
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
//
8
9
#import "PBGitRef.h"
10
11
12
@implementation PBGitRef
13
14
@synthesize ref;
15
- (NSString*) shortName
16
{
17
if ([self type])
18
return [ref substringFromIndex:[[self type] length] + 7];
19
return ref;
20
}
21
22
- (NSString*) type
23
{
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;
31
}
32
33
+ (PBGitRef*) refFromString: (NSString*) s
34
{
35
return [[PBGitRef alloc] initWithString:s];
36
}
37
38
- (PBGitRef*) initWithString: (NSString*) s
39
{
40
ref = s;
41
return self;
42
}
43
44
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
45
{
46
return NO;
47
}
48
49
+ (BOOL)isKeyExcludedFromWebScript:(const char *)name {
50
return NO;
51
}
52