Skip to content

Commit

Permalink
Teach --exec to git-archive --remote
Browse files Browse the repository at this point in the history
Some people needed --exec to specify the location of the upload-pack
executable, because their default SSH log-in does not include the
directory they have their own private copy of git on the $PATH.
These people need to be able to say --exec to git-archive --remote
for the same reason.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Sep 10, 2006
1 parent e0ffb24 commit fe5ab76
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions builtin-archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,30 @@ static int run_remote_archiver(const char *remote, int argc,
char *url, buf[1024];
int fd[2], i, len, rv;
pid_t pid;
const char *exec = "git-upload-archive";
int exec_at = 0;

sprintf(buf, "git-upload-archive");
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
if (!strncmp("--exec=", arg, 7)) {
if (exec_at)
die("multiple --exec specified");
exec = arg + 7;
exec_at = i;
break;
}
}

url = xstrdup(remote);
pid = git_connect(fd, url, buf);
pid = git_connect(fd, url, exec);
if (pid < 0)
return pid;

for (i = 1; i < argc; i++)
for (i = 1; i < argc; i++) {
if (i == exec_at)
continue;
packet_write(fd[1], "argument %s\n", argv[i]);
}
packet_flush(fd[1]);

len = packet_read_line(fd[0], buf, sizeof(buf));
Expand Down

0 comments on commit fe5ab76

Please sign in to comment.