From 156d67f1fb27368690685d167dd2194c7fbc6232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Tue, 30 Mar 2010 15:11:16 +0200 Subject: [PATCH] Add -debugDescription and -description to PBGitRef --- PBGitRef.h | 3 +++ PBGitRef.m | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/PBGitRef.h b/PBGitRef.h index 80bae6e..67b7b20 100644 --- a/PBGitRef.h +++ b/PBGitRef.h @@ -42,6 +42,9 @@ extern NSString * const kGitXRemoteRefPrefix; - (PBGitRef *) remoteRef; +- (NSString *)description; +- (NSString *)debugDescription; + - (BOOL) isEqualToRef:(PBGitRef *)otherRef; + (PBGitRef*) refFromString: (NSString*) s; diff --git a/PBGitRef.m b/PBGitRef.m index c9ab938..47faae9 100644 --- a/PBGitRef.m +++ b/PBGitRef.m @@ -66,6 +66,10 @@ NSString * const kGitXRemoteRefPrefix = @"refs/remotes/"; return nil; } +- (NSString *) description { + return [NSString stringWithFormat:@" ref = %@", self, self.ref]; +} + - (BOOL) isBranch { return [ref hasPrefix:kGitXBranchRefPrefix]; @@ -122,6 +126,10 @@ NSString * const kGitXRemoteRefPrefix = @"refs/remotes/"; return NO; } +- (NSString *)debugDescription { + return [NSString stringWithFormat:@" ref = %@, type = %@", self, ref, [self type]]; +} + #pragma mark