mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Make reloadRefs realize when something has gone horribly wrong.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user