X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=fetch-pack.c;h=3475ea380a29495269ac64fa9e4ff797b9b8687c;hb=12dd6e8cb0643231628d0240fdbb4afdef6629ea;hp=96ce7f5d5abd9faf66a189e583161e5860f582ef;hpb=4f7770c87ce3c302e1639a7737a6d2531fe4b160;p=git.git diff --git a/fetch-pack.c b/fetch-pack.c index 96ce7f5d..3475ea38 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -6,24 +6,6 @@ static const char fetch_pack_usage[] = "git-fetch-pack [host:]directory [heads]* < mycommitlist"; static const char *exec = "git-upload-pack"; -static int get_ack(int fd, unsigned char *result_sha1) -{ - static char line[1000]; - int len = packet_read_line(fd, line, sizeof(line)); - - if (!len) - die("git-fetch-pack: expected ACK/NAK, got EOF"); - if (line[len-1] == '\n') - line[--len] = 0; - if (!strcmp(line, "NAK")) - return 0; - if (!strncmp(line, "ACK ", 3)) { - if (!get_sha1_hex(line+4, result_sha1)) - return 1; - } - die("git-fetch_pack: expected ACK/NAK, got '%s'", line); -} - static int find_common(int fd[2], unsigned char *result_sha1, unsigned char *remote) { static char line[1000]; @@ -113,9 +95,9 @@ static int fetch_pack(int fd[2], int nr_match, char **match) if (pid < 0) die("git-fetch-pack: unable to fork off git-unpack-objects"); if (!pid) { - close(fd[1]); dup2(fd[0], 0); close(fd[0]); + close(fd[1]); execlp("git-unpack-objects", "git-unpack-objects", NULL); die("git-unpack-objects exec failed"); }