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