diff options
author | Ben Walton <bwalton@artsci.utoronto.ca> | 2010-01-19 14:03:09 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-19 12:21:34 -0800 |
commit | a12477dbe1be24c3948dd7994874d1d1187c40c3 (patch) | |
tree | 595dd4eef3fca8ee19e7440be10844045f912566 | |
parent | 640d9d08738db4380c2f856d60ac0a2ceb496c2f (diff) | |
download | git-a12477dbe1be24c3948dd7994874d1d1187c40c3.tar.gz git-a12477dbe1be24c3948dd7994874d1d1187c40c3.tar.xz |
cvsimport: standarize open() calls to external git tools
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>
-rwxr-xr-x | git-cvsimport.perl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git-cvsimport.perl b/git-cvsimport.perl index adffa0c3c..e838c2e0c 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -617,7 +617,7 @@ unless (-d $git_dir) { $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); @@ -631,8 +631,8 @@ unless (-d $git_dir) { # 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: $@"; @@ -730,7 +730,7 @@ sub update_index (\@\@) { } 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) |