aboutsummaryrefslogtreecommitdiff
path: root/send-pack.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-29 20:50:15 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-29 20:50:15 -0700
commitf3a3214e83be2905c57eff5d9035d169cae4644e (patch)
treed883e338e32ba1b07e31df7b2b9da44157d23210 /send-pack.c
parent61221472a5f8591f2d06d5e5c5aafb03271b8066 (diff)
downloadgit-f3a3214e83be2905c57eff5d9035d169cae4644e.tar.gz
git-f3a3214e83be2905c57eff5d9035d169cae4644e.tar.xz
Make send/receive-pack be closer to doing something interesting
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/send-pack.c b/send-pack.c
index af57d4028..99cb84b2c 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "pkt-line.h"
static const char send_pack_usage[] = "git-send-pack [--exec=other] destination [heads]*";
@@ -8,13 +9,16 @@ static int send_pack(int in, int out)
{
for (;;) {
static char buffer[1000];
- int ret = read(in, buffer, sizeof(buffer));
- if (ret > 0) {
- write(1, buffer, ret);
+ int len;
+
+ len = packet_read_line(in, buffer, sizeof(buffer));
+ if (len > 0) {
+ write(2, buffer, len);
continue;
}
break;
}
+ packet_flush(out);
close(out);
return 0;
}
@@ -77,7 +81,7 @@ static int setup_connection(int fd[2], char *url, char **heads)
if (host)
execlp("ssh", "ssh", host, command, NULL);
else
- execlp(host, command, NULL);
+ execlp("sh", "sh", "-c", command, NULL);
die("exec failed");
}
fd[0] = pipefd[0][0];