Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Teach --exec to git-archive --remote

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...
commit fe5ab763f848cfcda22001f9280625f06c4c3760 1 parent e0ffb24
authored September 10, 2006

Showing 1 changed file with 17 additions and 3 deletions. Show diff stats Hide diff stats

  1. 20  builtin-archive.c
20  builtin-archive.c
@@ -32,16 +32,30 @@ static int run_remote_archiver(const char *remote, int argc,
32 32
 	char *url, buf[1024];
33 33
 	int fd[2], i, len, rv;
34 34
 	pid_t pid;
  35
+	const char *exec = "git-upload-archive";
  36
+	int exec_at = 0;
35 37
 
36  
-	sprintf(buf, "git-upload-archive");
  38
+	for (i = 1; i < argc; i++) {
  39
+		const char *arg = argv[i];
  40
+		if (!strncmp("--exec=", arg, 7)) {
  41
+			if (exec_at)
  42
+				die("multiple --exec specified");
  43
+			exec = arg + 7;
  44
+			exec_at = i;
  45
+			break;
  46
+		}
  47
+	}
37 48
 
38 49
 	url = xstrdup(remote);
39  
-	pid = git_connect(fd, url, buf);
  50
+	pid = git_connect(fd, url, exec);
40 51
 	if (pid < 0)
41 52
 		return pid;
42 53
 
43  
-	for (i = 1; i < argc; i++)
  54
+	for (i = 1; i < argc; i++) {
  55
+		if (i == exec_at)
  56
+			continue;
44 57
 		packet_write(fd[1], "argument %s\n", argv[i]);
  58
+	}
45 59
 	packet_flush(fd[1]);
46 60
 
47 61
 	len = packet_read_line(fd[0], buf, sizeof(buf));

0 notes on commit fe5ab76

Please sign in to comment.
Something went wrong with that request. Please try again.