summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 640d9d0)
raw | patch | inline | side by side (parent: 640d9d0)
author | Ben Walton <bwalton@artsci.utoronto.ca> | |
Tue, 19 Jan 2010 19:03:09 +0000 (14:03 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 19 Jan 2010 20:21:34 +0000 (12:21 -0800) |
Standardize calls to open() where external git tools are used as
part of a pipeline. Instead of open(X, "git foo ... |)", use
open(X, "-|", qw(git foo ...)). All calls are made without the
use of an 'sh -c' process to split the arguments.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
part of a pipeline. Instead of open(X, "git foo ... |)", use
open(X, "-|", qw(git foo ...)). All calls are made without the
use of an 'sh -c' process to split the arguments.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-cvsimport.perl | patch | blob | history |
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index adffa0c3cd486bcbe1a9e0a459aa2d1ec00d79d1..e838c2e0cd73f1b15a5033f2180d519f42dbd93b 100755 (executable)
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
$last_branch = $opt_o;
$orig_branch = "";
} else {
- open(F, "git symbolic-ref HEAD |") or
+ open(F, "-|", qw(git symbolic-ref HEAD)) or
die "Cannot run git symbolic-ref: $!\n";
chomp ($last_branch = <F>);
$last_branch = basename($last_branch);
# Get the last import timestamps
my $fmt = '($ref, $author) = (%(refname), %(author));';
- open(H, "git for-each-ref --perl --format='$fmt' $remote |") or
- die "Cannot run git for-each-ref: $!\n";
+ my @cmd = ('git', 'for-each-ref', '--perl', "--format=$fmt", $remote);
+ open(H, "-|", @cmd) or die "Cannot run git for-each-ref: $!\n";
while (defined(my $entry = <H>)) {
my ($ref, $author);
eval($entry) || die "cannot eval refs list: $@";
}
sub write_tree () {
- open(my $fh, '-|', "git write-tree")
+ open(my $fh, '-|', qw(git write-tree))
or die "unable to open git write-tree: $!";
chomp(my $tree = <$fh>);
is_sha1($tree)