. '%an' . '%x00' # author name
. '%s' . '%x00' # subject
. '%d'; # ref names
-my $cmd = "git log --all --graph --format='$format'";
-open my $fh, '-|', $cmd or die $!;
+my @cmd = ('git', 'log', '--all', '--graph', "--format=$format");
+open my $fh, '-|', @cmd or die $!;
while (my $line = <$fh>) {
# History graph line.
}
# Commit line.
- $line =~ /^([ *|]+)\x00(.+)\x00(.+)\x00(.+)\x00(.+)\x00(.*)$/
+ $line =~ /^([ *|.-]+)\x00(.+)\x00(.+)\x00(.+)\x00(.+)\x00(.*)$/
or die $line;
my $prefix = $1;
my $hash = colored($2, $color_hash);
my $message = $5;
my $refs = $6;
+ # Strip trailing whitespace.
+ $prefix =~ s/\s+$//;
# Color "graph".
$prefix =~ s/\|/colored($&, $color_graph)/ge;