Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
archimport: use safe_pipe_capture for user input
author
Jeff King
<peff@peff.net>
Mon, 11 Sep 2017 14:24:11 +0000
(10:24 -0400)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 12 Sep 2017 02:08:15 +0000
(11:08 +0900)
Refnames can contain shell metacharacters which need to be
passed verbatim to sub-processes. Using safe_pipe_capture
skips the shell entirely.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-archimport.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
4d4165b
)
diff --git
a/git-archimport.perl
b/git-archimport.perl
index 9cb123a07df88c975cf1b0d6c5832cb410175dd0..b7c173c345544d61a887cfbebb58703478a29d2d 100755
(executable)
--- a/
git-archimport.perl
+++ b/
git-archimport.perl
@@
-983,7
+983,7
@@
sub find_parents {
# check that we actually know about the branch
next unless -e "$git_dir/refs/heads/$branch";
# check that we actually know about the branch
next unless -e "$git_dir/refs/heads/$branch";
- my $mergebase =
`git-merge-base $branch $ps->{branch}`
;
+ my $mergebase =
safe_pipe_capture(qw(git-merge-base), $branch, $ps->{branch})
;
if ($?) {
# Don't die here, Arch supports one-way cherry-picking
# between branches with no common base (or any relationship
if ($?) {
# Don't die here, Arch supports one-way cherry-picking
# between branches with no common base (or any relationship
@@
-1074,7
+1074,7
@@
sub find_parents {
sub git_rev_parse {
my $name = shift;
sub git_rev_parse {
my $name = shift;
- my $val =
`git-rev-parse $name`
;
+ my $val =
safe_pipe_capture(qw(git-rev-parse), $name)
;
die "Error: git-rev-parse $name" if $?;
chomp $val;
return $val;
die "Error: git-rev-parse $name" if $?;
chomp $val;
return $val;