From 8ae2cde4379551d92c5430d8117016320f0f1595 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Mon, 7 Sep 2009 23:07:14 +0200 Subject: [PATCH] GitRevList: Always run --children It's very difficult to determine whether or not we have a path specifier. Because it's so difficult, it's better to just always run --children. A quick test indicates that it doesn't matter much in run-time, and it's better to be conservative in what we accept than to show bogus lines because the children haven't been rewritten. --- PBGitRevList.mm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/PBGitRevList.mm b/PBGitRevList.mm index b2d8a49..9de94cb 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -74,21 +74,19 @@ using namespace std; PBGitGrapher* g = [[PBGitGrapher alloc] initWithRepository: repository]; std::map encodingMap; - NSMutableArray* arguments; + NSString *formatString = @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at"; BOOL showSign = [rev hasLeftRight]; if (showSign) - arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at\01%m", nil]; - else - arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at", nil]; + formatString = [formatString stringByAppendingString:@"\01%m"]; + + NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--children", formatString, nil]; if (!rev) [arguments addObject:@"HEAD"]; else [arguments addObjectsFromArray:[rev parameters]]; - if ([rev hasPathLimiter]) - [arguments insertObject:@"--children" atIndex:1]; NSTask *task = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:arguments inDir:[repository fileURL].path]; [task launch]; -- 2.11.4.GIT