Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (46 sloc) 1.187 kb
//
// PBGitCommit.m
// GitTest
//
// Created by Pieter de Bie on 13-06-08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "PBGitCommit.h"
@implementation PBGitCommit
@synthesize sha, repository, subject, author, date, parents;
- (NSString *) dateString
{
NSDateFormatter* formatter = [[NSDateFormatter alloc] initWithDateFormat:@"%Y-%m-%d %H:%M:%S" allowNaturalLanguage:NO];
return [formatter stringFromDate: self.date];
}
- (NSArray*) treeContents
{
return self.tree.children;
}
- initWithRepository:(PBGitRepository*) repo andSha:(NSString*) newSha
{
details = nil;
self.repository = repo;
self.sha = newSha;
return self;
}
- (NSString*) details
{
if (details != nil)
return details;
NSFileHandle* handle = [self.repository handleForCommand:[@"show --pretty=raw " stringByAppendingString:self.sha]];
details = [[NSString alloc] initWithData:[handle readDataToEndOfFile] encoding: NSUTF8StringEncoding];
return details;
}
- (PBGitTree*) tree
{
return [PBGitTree rootForCommit: self];
}
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
{
return NO;
}
+ (BOOL)isKeyExcludedFromWebScript:(const char *)name {
return NO;
}
@end
Jump to Line
Something went wrong with that request. Please try again.