]>
Commit | Line | Data |
---|---|---|
1fcc8ea5 LT |
1 | #include "cache.h" |
2 | #include "refs.h" | |
3 | #include "pkt-line.h" | |
4 | #include <sys/wait.h> | |
5 | ||
6 | static const char clone_pack_usage[] = "git-clone-pack [host:]directory [heads]*"; | |
7 | static const char *exec = "git-upload-pack"; | |
8 | ||
9 | struct ref { | |
10 | struct ref *next; | |
11 | unsigned char sha1[20]; | |
12 | char name[0]; | |
13 | }; | |
14 | ||
dd7ba8b4 | 15 | static struct ref *get_remote_refs(int fd, int nr_match, char **match) |
1fcc8ea5 LT |
16 | { |
17 | struct ref *ref_list = NULL, **next_ref = &ref_list; | |
18 | ||
19 | for (;;) { | |
20 | static char line[1000]; | |
21 | unsigned char sha1[20]; | |
22 | struct ref *ref; | |
23 | char *refname; | |
24 | int len; | |
25 | ||
26 | len = packet_read_line(fd, line, sizeof(line)); | |
27 | if (!len) | |
28 | break; | |
29 | if (line[len-1] == '\n') | |
30 | line[--len] = 0; | |
31 | if (len < 42 || get_sha1_hex(line, sha1)) | |
32 | Content-type: text/html ]>