ewah: support platforms that require aligned reads
[gitweb.git] / send-pack.c
index 8c230bf6c925ba6bd3617af62f44cfea8dc09a7b..b228d65613c511ffa59eb3ab254ee2e2b6f26c9b 100644 (file)
@@ -5,6 +5,7 @@
 #include "sideband.h"
 #include "run-command.h"
 #include "remote.h"
+#include "connect.h"
 #include "send-pack.h"
 #include "quote.h"
 #include "transport.h"
@@ -106,9 +107,8 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
 static int receive_status(int in, struct ref *refs)
 {
        struct ref *hint;
-       char line[1000];
        int ret = 0;
-       int len = packet_read_line(in, line, sizeof(line));
+       char *line = packet_read_line(in, NULL);
        if (prefixcmp(line, "unpack "))
                return error("did not receive remote status");
        if (strcmp(line, "unpack ok")) {
@@ -119,8 +119,8 @@ static int receive_status(int in, struct ref *refs)
        while (1) {
                char *refname;
                char *msg;
-               len = packet_read_line(in, line, sizeof(line));
-               if (!len)
+               line = packet_read_line(in, NULL);
+               if (!line)
                        break;
                if (prefixcmp(line, "ok ") && prefixcmp(line, "ng ")) {
                        error("invalid ref status from remote: %s", line);
@@ -227,6 +227,7 @@ int send_pack(struct send_pack_args *args,
                case REF_STATUS_REJECT_ALREADY_EXISTS:
                case REF_STATUS_REJECT_FETCH_FIRST:
                case REF_STATUS_REJECT_NEEDS_FORCE:
+               case REF_STATUS_REJECT_STALE:
                case REF_STATUS_UPTODATE:
                        continue;
                default: