X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=connect.c;h=c2badc71aa2ccf63fa6d9ef02a5ee76feb54e5c9;hb=942c1f53aef03cb3d8b5c39b38997a379c3fad20;hp=5cc49f975abf7d760f2064402cae2a38bc6a7976;hpb=211b5f9e62cc961acda59392fbf5a3efa8106c97;p=git.git diff --git a/connect.c b/connect.c index 5cc49f97..c2badc71 100644 --- a/connect.c +++ b/connect.c @@ -8,7 +8,7 @@ #include #include -static char *server_capabilities = ""; +static char *server_capabilities = NULL; /* * Read all the refs from the other end @@ -58,7 +58,8 @@ struct ref **get_remote_heads(int in, struct ref **list, int server_supports(const char *feature) { - return strstr(feature, server_capabilities) != NULL; + return server_capabilities && + strstr(server_capabilities, feature) != NULL; } int get_ack(int fd, unsigned char *result_sha1) @@ -73,8 +74,11 @@ int get_ack(int fd, unsigned char *result_sha1) if (!strcmp(line, "NAK")) return 0; if (!strncmp(line, "ACK ", 3)) { - if (!get_sha1_hex(line+4, result_sha1)) + if (!get_sha1_hex(line+4, result_sha1)) { + if (strstr(line+45, "continue")) + return 2; return 1; + } } die("git-fetch_pack: expected ACK/NAK, got '%s'", line); }