X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=connect.c;h=584e04c217da4ea8943e33c77fea56ce64547ed1;hb=a80732897931c737c01d04289dd1512bd12a4b04;hp=67d2cd86a89a92f8f75baa7ae5e820ac3150f3b4;hpb=46dc1b0e332612aa32c139007fa33f4b429de9d1;p=git.git diff --git a/connect.c b/connect.c index 67d2cd86a..584e04c21 100644 --- a/connect.c +++ b/connect.c @@ -70,6 +70,9 @@ struct ref **get_remote_heads(int in, struct ref **list, if (buffer[len-1] == '\n') buffer[--len] = 0; + if (len > 4 && !prefixcmp(buffer, "ERR ")) + die("remote error: %s", buffer + 4); + if (len < 42 || get_sha1_hex(buffer, old_sha1) || buffer[40] != ' ') die("protocol error: expected sha/ref, got '%s'", buffer); name = buffer + 41; @@ -90,9 +93,8 @@ struct ref **get_remote_heads(int in, struct ref **list, continue; if (nr_match && !path_match(name, nr_match, match)) continue; - ref = alloc_ref(name_len + 1); + ref = alloc_ref(buffer + 41); hashcpy(ref->old_sha1, old_sha1); - memcpy(ref->name, buffer + 41, name_len + 1); *list = ref; list = &ref->next; }