summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2007-11-01 13:47:47 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-11-01 13:47:47 -0700
commit4340a813d007b592534de664d152d66417dbe809 (patch)
tree731be77f39c37cd0c6b1ddf5bf8e50f1692ae9e7 /transport.c
parentMerge branch 'sp/mergetool' (diff)
parentUse the asyncronous function infrastructure to run the content filter. (diff)
downloadtgif-4340a813d007b592534de664d152d66417dbe809.tar.xz
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 'transport.c')
-rw-r--r--transport.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/transport.c b/transport.c
index 400af71c76..5132d289da 100644
--- a/transport.c
+++ b/transport.c
@@ -601,18 +601,13 @@ static struct ref *get_refs_via_connect(const struct transport *transport)
struct git_transport_data *data = transport->data;
struct ref *refs;
int fd[2];
- pid_t pid;
char *dest = xstrdup(transport->url);
-
- pid = git_connect(fd, dest, data->uploadpack, 0);
-
- if (pid < 0)
- die("Failed to connect to \"%s\"", transport->url);
+ struct child_process *conn = git_connect(fd, dest, data->uploadpack, 0);
get_remote_heads(fd[0], &refs, 0, NULL, 0);
packet_flush(fd[1]);
- finish_connect(pid);
+ finish_connect(conn);
free(dest);