5 // Created by Pieter de Bie on 13-06-08.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
9 #import "PBGitCommit.h"
12 @implementation PBGitCommit
14 @synthesize sha, repository, subject, author, date, parents, sign, lineInfo, refs;
17 - (NSString *) dateString
19 NSDateFormatter* formatter = [[NSDateFormatter alloc] initWithDateFormat:@"%Y-%m-%d %H:%M:%S" allowNaturalLanguage:NO];
20 return [formatter stringFromDate: self.date];
23 - (NSArray*) treeContents
25 return self.tree.children;
28 - initWithRepository:(PBGitRepository*) repo andSha:(NSString*) newSha
31 self.repository = repo;
41 NSFileHandle* handle = [self.repository handleForCommand:[@"show --pretty=raw " stringByAppendingString:self.sha]];
42 details = [[NSString alloc] initWithData:[handle readDataToEndOfFile] encoding: NSUTF8StringEncoding];
52 NSString *p = [repository outputForArguments:[NSArray arrayWithObjects:@"format-patch", @"-1", @"--stdout", sha, nil]];
53 // Add a GitX identifier to the patch ;)
54 _patch = [[p substringToIndex:[p length] -1] stringByAppendingString:@"+GitX"];
60 return [PBGitTree rootForCommit: self];
63 + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
68 + (BOOL)isKeyExcludedFromWebScript:(const char *)name {