cvsserver: use safe_pipe_capture for `constant commands` as well
This is not strictly necessary, but it is a good code hygiene. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Sep 11, 2017 at 14:45 UTC
46203ac24dc7e6b5a8d4f1b024ed93591705d47b
1 file changed
+4
-4
git-cvsserver.perl
+4
-4
@@ -356,7 +356,7 @@ sub req_Root
356
return 0;
357
}
358
359
- my @gitvars = `git config -l`;
359
+ my @gitvars = safe_pipe_capture(qw(git config -l));
360
if ($?) {
361
print "E problems executing git-config on the server -- this is not a git repository or the PATH is not set correctly.\n";
362
print "E \n";
@@ -943,7 +943,7 @@ sub req_co
943
944
# Provide list of modules, if -c was used.
945
if (exists $state->{opt}{c}) {
946
- my $showref = `git show-ref --heads`;
946
+ my $showref = safe_pipe_capture(qw(git show-ref --heads));
947
for my $line (split '\n', $showref) {
948
if ( $line =~ m% refs/heads/(.*)$% ) {
949
print "M $1\t$1\n";
@@ -1181,7 +1181,7 @@ sub req_update
1181
# projects (heads in this case) to checkout.
1182
#
1183
if ($state->{module} eq '') {
1184
- my $showref = `git show-ref --heads`;
1184
+ my $showref = safe_pipe_capture(qw(git show-ref --heads));
1185
print "E cvs update: Updating .\n";
1186
for my $line (split '\n', $showref) {
1187
if ( $line =~ m% refs/heads/(.*)$% ) {
@@ -1687,7 +1687,7 @@ sub req_ci
1687
return;
1688
}
1689
1690
- my $treehash = `git write-tree`;
1690
+ my $treehash = safe_pipe_capture(qw(git write-tree));
1691
chomp $treehash;
1692
1693
$log->debug("Treehash : $treehash, Parenthash : $parenthash");