summaryrefslogtreecommitdiff
path: root/builtin-archive.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-01 13:47:47 -0700
committerJunio C Hamano <gitster@pobox.com>2007-11-01 13:47:47 -0700
commit4340a813d007b592534de664d152d66417dbe809 (patch)
tree731be77f39c37cd0c6b1ddf5bf8e50f1692ae9e7 /builtin-archive.c
parent6959893b0b65ebc68ce2fb524a8ec15a26ca4972 (diff)
parent546bb5823249678bc6ad11e65661d896ed83448a (diff)
downloadgit-4340a813d007b592534de664d152d66417dbe809.tar.gz
Merge branch 'js/forkexec'
* js/forkexec: Use the asyncronous function infrastructure to run the content filter. Avoid a dup2(2) in apply_filter() - start_command() can do it for us. t0021-conversion.sh: Test that the clean filter really cleans content. upload-pack: Run rev-list in an asynchronous function. upload-pack: Move the revision walker into a separate function. Use the asyncronous function infrastructure in builtin-fetch-pack.c. Add infrastructure to run a function asynchronously. upload-pack: Use start_command() to run pack-objects in create_pack_file(). Have start_command() create a pipe to read the stderr of the child. Use start_comand() in builtin-fetch-pack.c instead of explicit fork/exec. Use run_command() to spawn external diff programs instead of fork/exec. Use start_command() to run content filters instead of explicit fork/exec. Use start_command() in git_connect() instead of explicit fork/exec. Change git_connect() to return a struct child_process instead of a pid_t. Conflicts: builtin-fetch-pack.c
Diffstat (limited to 'builtin-archive.c')
-rw-r--r--builtin-archive.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin-archive.c b/builtin-archive.c
index 6f29c2f40a..14a1b3077c 100644
--- a/builtin-archive.c
+++ b/builtin-archive.c
@@ -30,7 +30,7 @@ static int run_remote_archiver(const char *remote, int argc,
{
char *url, buf[LARGE_PACKET_MAX];
int fd[2], i, len, rv;
- pid_t pid;
+ struct child_process *conn;
const char *exec = "git-upload-archive";
int exec_at = 0;
@@ -46,9 +46,7 @@ static int run_remote_archiver(const char *remote, int argc,
}
url = xstrdup(remote);
- pid = git_connect(fd, url, exec, 0);
- if (pid < 0)
- return pid;
+ conn = git_connect(fd, url, exec, 0);
for (i = 1; i < argc; i++) {
if (i == exec_at)
@@ -76,7 +74,7 @@ static int run_remote_archiver(const char *remote, int argc,
rv = recv_sideband("archive", fd[0], 1, 2);
close(fd[0]);
close(fd[1]);
- rv |= finish_connect(pid);
+ rv |= finish_connect(conn);
return !!rv;
}