Code

Use OPT_BIT in builtin-for-each-ref
[git.git] / fast-import.c
index a870a44e3d1a266f856738ac1242158482dc59dc..f93d7d6c9bf2db021ceb65766da87af32aecc1d1 100644 (file)
@@ -1562,7 +1562,7 @@ static int read_next_command(void)
                } else {
                        struct recent_command *rc;
 
-                       strbuf_detach(&command_buf);
+                       strbuf_detach(&command_buf, NULL);
                        stdin_eof = strbuf_getline(&command_buf, stdin, '\n');
                        if (stdin_eof)
                                return EOF;
@@ -1616,6 +1616,7 @@ static void cmd_data(struct strbuf *sb)
                char *term = xstrdup(command_buf.buf + 5 + 2);
                size_t term_len = command_buf.len - 5 - 2;
 
+               strbuf_detach(&command_buf, NULL);
                for (;;) {
                        if (strbuf_getline(&command_buf, stdin, '\n') == EOF)
                                die("EOF in data (terminator '%s' not found)", term);
@@ -1817,7 +1818,7 @@ static void file_change_m(struct branch *b)
        } else if (oe) {
                if (oe->type != OBJ_BLOB)
                        die("Not a blob (actually a %s): %s",
-                               command_buf.buf, typename(oe->type));
+                               typename(oe->type), command_buf.buf);
        } else {
                enum object_type type = sha1_object_info(sha1, NULL);
                if (type < 0)