Skip to content

Commit 8ae2cde

Browse files
committed
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.
1 parent 86ea9b5 commit 8ae2cde

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

PBGitRevList.mm

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,19 @@ - (void) walkRevisionListWithSpecifier: (PBGitRevSpecifier*) rev
7474
PBGitGrapher* g = [[PBGitGrapher alloc] initWithRepository: repository];
7575
std::map<string, NSStringEncoding> encodingMap;
7676

77-
NSMutableArray* arguments;
77+
NSString *formatString = @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at";
7878
BOOL showSign = [rev hasLeftRight];
7979

8080
if (showSign)
81-
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];
82-
else
83-
arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at", nil];
81+
formatString = [formatString stringByAppendingString:@"\01%m"];
82+
83+
NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--children", formatString, nil];
8484

8585
if (!rev)
8686
[arguments addObject:@"HEAD"];
8787
else
8888
[arguments addObjectsFromArray:[rev parameters]];
8989

90-
if ([rev hasPathLimiter])
91-
[arguments insertObject:@"--children" atIndex:1];
9290

9391
NSTask *task = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:arguments inDir:[repository fileURL].path];
9492
[task launch];

0 commit comments

Comments
 (0)