Merge branch 'jc/apply-ws-fix-tab-in-indent'
[gitweb.git] / builtin / receive-pack.c
index 62ba6e7a3d014be01fe01ed497c083f7e44e9d34..ccebd74f166f5d02e8e6a0bb6033d741f8580f7b 100644 (file)
@@ -754,17 +754,15 @@ static struct command *read_head_info(void)
        struct command *commands = NULL;
        struct command **p = &commands;
        for (;;) {
-               static char line[1000];
+               char *line;
                unsigned char old_sha1[20], new_sha1[20];
                struct command *cmd;
                char *refname;
                int len, reflen;
 
-               len = packet_read_line(0, line, sizeof(line));
-               if (!len)
+               line = packet_read_line(0, &len);
+               if (!line)
                        break;
-               if (line[len-1] == '\n')
-                       line[--len] = 0;
                if (len < 83 ||
                    line[40] != ' ' ||
                    line[81] != ' ' ||
@@ -932,7 +930,7 @@ static void report(struct command *commands, const char *unpack_status)
        if (use_sideband)
                send_sideband(1, 1, buf.buf, buf.len, use_sideband);
        else
-               safe_write(1, buf.buf, buf.len);
+               write_or_die(1, buf.buf, buf.len);
        strbuf_release(&buf);
 }