From e25aec668bf3c41bc24ee5435557efd2dfe4f0a2 Mon Sep 17 00:00:00 2001 From: Christian Jacobsen Date: Mon, 29 Sep 2008 20:35:19 +0200 Subject: [PATCH] GitRepository: Skip empty lines when parsing refs This fixes loading repositories. --- PBGitRepository.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PBGitRepository.m b/PBGitRepository.m index a561cf6..5b4e0cc 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -213,6 +213,10 @@ static NSString* gitPath; NSArray* lines = [output componentsSeparatedByString:@"\n"]; for (NSString* line in lines) { + // If its an empty line, skip it (e.g. with empty repositories) + if ([line length] == 0) + continue; + NSArray* components = [line componentsSeparatedByString:@" "]; // First do the ref matching. If this ref is new, add it to our ref list