Skip to content

Commit 18aff08

Browse files
committed
Merge branch 'jc/undash-in-tree-git-callers'
A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. * jc/undash-in-tree-git-callers: credential-cache: use child_process.args cvsexportcommit: do not run git programs in dashed form transport-helper: do not run git-remote-ext etc. in dashed form
2 parents afd49c3 + c0e190c commit 18aff08

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

builtin/credential-cache.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ static int send_request(const char *socket, const struct strbuf *out)
4242
static void spawn_daemon(const char *socket)
4343
{
4444
struct child_process daemon = CHILD_PROCESS_INIT;
45-
const char *argv[] = { NULL, NULL, NULL };
4645
char buf[128];
4746
int r;
4847

49-
argv[0] = "git-credential-cache--daemon";
50-
argv[1] = socket;
51-
daemon.argv = argv;
48+
strvec_pushl(&daemon.args,
49+
"credential-cache--daemon", socket,
50+
NULL);
51+
daemon.git_cmd = 1;
5252
daemon.no_stdin = 1;
5353
daemon.out = -1;
5454

git-cvsexportcommit.perl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# Remember where GIT_DIR is before changing to CVS checkout
3131
unless ($ENV{GIT_DIR}) {
3232
# No GIT_DIR set. Figure it out for ourselves
33-
my $gd =`git-rev-parse --git-dir`;
33+
my $gd =`git rev-parse --git-dir`;
3434
chomp($gd);
3535
$ENV{GIT_DIR} = $gd;
3636
}
@@ -66,7 +66,7 @@
6666
# resolve target commit
6767
my $commit;
6868
$commit = pop @ARGV;
69-
$commit = safe_pipe_capture('git-rev-parse', '--verify', "$commit^0");
69+
$commit = safe_pipe_capture('git', 'rev-parse', '--verify', "$commit^0");
7070
chomp $commit;
7171
if ($?) {
7272
die "The commit reference $commit did not resolve!";
@@ -76,15 +76,15 @@
7676
my $parent;
7777
if (@ARGV) {
7878
$parent = pop @ARGV;
79-
$parent = safe_pipe_capture('git-rev-parse', '--verify', "$parent^0");
79+
$parent = safe_pipe_capture('git', 'rev-parse', '--verify', "$parent^0");
8080
chomp $parent;
8181
if ($?) {
8282
die "The parent reference did not resolve!";
8383
}
8484
}
8585

8686
# find parents from the commit itself
87-
my @commit = safe_pipe_capture('git-cat-file', 'commit', $commit);
87+
my @commit = safe_pipe_capture('git', 'cat-file', 'commit', $commit);
8888
my @parents;
8989
my $committer;
9090
my $author;
@@ -162,9 +162,9 @@
162162
close MSG;
163163

164164
if ($parent eq $noparent) {
165-
`git-diff-tree --binary -p --root $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
165+
`git diff-tree --binary -p --root $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
166166
} else {
167-
`git-diff-tree --binary -p $parent $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
167+
`git diff-tree --binary -p $parent $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
168168
}
169169

170170
## apply non-binary changes
@@ -178,7 +178,7 @@
178178
print "Checking if patch will apply\n";
179179

180180
my @stat;
181-
open APPLY, "GIT_INDEX_FILE=$tmpdir/index git-apply $context --summary --numstat<.cvsexportcommit.diff|" || die "cannot patch";
181+
open APPLY, "GIT_INDEX_FILE=$tmpdir/index git apply $context --summary --numstat<.cvsexportcommit.diff|" || die "cannot patch";
182182
@stat=<APPLY>;
183183
close APPLY || die "Cannot patch";
184184
my (@bfiles,@files,@afiles,@dfiles);
@@ -333,7 +333,7 @@
333333
if ($opt_W) {
334334
system("git checkout -q $commit^0") && die "cannot patch";
335335
} else {
336-
`GIT_INDEX_FILE=$tmpdir/index git-apply $context --summary --numstat --apply <.cvsexportcommit.diff` || die "cannot patch";
336+
`GIT_INDEX_FILE=$tmpdir/index git apply $context --summary --numstat --apply <.cvsexportcommit.diff` || die "cannot patch";
337337
}
338338

339339
print "Patch applied successfully. Adding new files and directories to CVS\n";

transport-helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ static struct child_process *get_helper(struct transport *transport)
128128
helper->in = -1;
129129
helper->out = -1;
130130
helper->err = 0;
131-
strvec_pushf(&helper->args, "git-remote-%s", data->name);
131+
strvec_pushf(&helper->args, "remote-%s", data->name);
132132
strvec_push(&helper->args, transport->remote->name);
133133
strvec_push(&helper->args, remove_ext_force(transport->url));
134-
helper->git_cmd = 0;
134+
helper->git_cmd = 1;
135135
helper->silent_exec_failure = 1;
136136

137137
if (have_git_dir())

0 commit comments

Comments
 (0)