summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e0ffb24)
raw | patch | inline | side by side (parent: e0ffb24)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 10 Sep 2006 11:02:57 +0000 (04:02 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 10 Sep 2006 20:39:32 +0000 (13:39 -0700) |
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>
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>
builtin-archive.c | patch | blob | history |
diff --git a/builtin-archive.c b/builtin-archive.c
index 7544ad3ca1a69b7bd0a9026e03405003d002cf43..dd7ffc043d48c5480f90905e812f615cd4895feb 100644 (file)
--- a/builtin-archive.c
+++ b/builtin-archive.c
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));