diff --git a/PBGitRepository.m b/PBGitRepository.m index 8f0f92c..69d8405 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -280,6 +280,11 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; else sha = [PBGitSHA shaWithString:[components objectAtIndex:2]]; + if(!sha) { + NSLog(@"sha was nil...? ref=%@, components=%@",ref,components); + return; + } + NSMutableArray* curRefs; if ( (curRefs = [refs objectForKey:sha]) != nil ) [curRefs addObject:ref]; @@ -299,6 +304,13 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; NSString *output = [self outputForArguments:arguments]; NSArray *lines = [output componentsSeparatedByString:@"\n"]; + if([output hasPrefix:@"fatal: "]) { + NSLog(@"Unable to read refs!"); + NSLog(@"arguments=%@",arguments); + NSLog(@"output=%@",output); + @throw output; + } + for (NSString *line in lines) { // If its an empty line, skip it (e.g. with empty repositories) if ([line length] == 0)