Add -description and/or -debugDescription methods to PBGitCommit, PBGitRef and PBGitRevSpecifier.

This commit is contained in:
André Berg
2010-04-05 10:41:24 +02:00
parent 3158d0f8e6
commit d76072f5e7
3 changed files with 16 additions and 5 deletions
+5
View File
@@ -33,6 +33,11 @@ NSString * const kGitXCommitType = @"commit";
return p;
}
- (NSString *) description {
return [NSString stringWithFormat:@"%@, realSha = %@, %d parent(s), repository = %@",
[super description], [self realSha], nParents, repository];
}
- (NSDate *)date
{
return [NSDate dateWithTimeIntervalSince1970:timestamp];
+6 -5
View File
@@ -67,7 +67,12 @@ NSString * const kGitXRemoteRefPrefix = @"refs/remotes/";
}
- (NSString *) description {
return [NSString stringWithFormat:@"<PBGitRef %p> ref = %@", self, self.ref];
return [NSString stringWithFormat:@"<PBGitRef: %p> ref = %@", self, self.ref];
}
- (NSString *)debugDescription {
return [NSString stringWithFormat:@"<PBGitRef: %p>, ref = %@, type = %@", self, ref, [self type]];
}
- (BOOL) isBranch
@@ -126,10 +131,6 @@ NSString * const kGitXRemoteRefPrefix = @"refs/remotes/";
return NO;
}
- (NSString *)debugDescription {
return [NSString stringWithFormat:@"<PBGitRef %p> ref = %@, type = %@", self, ref, [self type]];
}
#pragma mark <PBGitRefish>
+5
View File
@@ -87,6 +87,11 @@
return description;
}
- (NSString *) debugDescription {
return [NSString stringWithFormat:@"<%@: %p> description = %@, parameters = %@",
NSStringFromClass([self class]), self, description, parameters];
}
- (NSString *) title
{
NSString *title = nil;