]> asedeno.scripts.mit.edu Git - git.git/blobdiff - connect.c
Stop using compat/regex.c on platforms with working regexp library
[git.git] / connect.c
index b69060bca0917cf84612f861dbc8be5d1c6f775c..584e04c217da4ea8943e33c77fea56ce64547ed1 100644 (file)
--- 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,7 +93,7 @@ struct ref **get_remote_heads(int in, struct ref **list,
                        continue;
                if (nr_match && !path_match(name, nr_match, match))
                        continue;
-               ref = alloc_ref_from_str(buffer + 41);
+               ref = alloc_ref(buffer + 41);
                hashcpy(ref->old_sha1, old_sha1);
                *list = ref;
                list = &ref->next;