# by grouping branches and tags together to form a single line.
use strict;
+use Git;
+
+my $repo = Git->repository();
my @src;
my %src;
}
sub repoconfig {
- my ($val) = qx{git-repo-config --get merge.summary};
+ my ($val) = $repo->command_oneline('repo-config', '--get', 'merge.summary');
return $val;
}
sub current_branch {
- my ($bra) = qx{git-symbolic-ref HEAD};
- chomp($bra);
+ my ($bra) = $repo->command_oneline('symbolic-ref', 'HEAD');
$bra =~ s|^refs/heads/||;
if ($bra ne 'master') {
$bra = " into $bra";
sub shortlog {
my ($tip) = @_;
my @result;
- foreach ( qx{git-log --no-merges --topo-order --pretty=oneline $tip ^HEAD} ) {
+ foreach ($repo->command('log', '--no-merges', '--topo-order', '--pretty=oneline', $tip, '^HEAD')) {
s/^[0-9a-f]{40}\s+//;
push @result, $_;
}
- die "git-log failed\n" if $?;
return @result;
}
print " ...\n";
last;
}
- print " $log";
+ print " $log\n";
}
}