fast-import: fix erroneous handling of get-mark with empty orphan commits
[gitweb.git] / fast-import.c
index 338db61e6e7bbb2ce41cf2057bf1c2df2496a09c..064c55e8becfca27473549b4997cdbd58b4ebf07 100644 (file)
@@ -1748,8 +1748,6 @@ static int read_next_command(void)
        }
 
        for (;;) {
-               const char *p;
-
                if (unread_command_buf) {
                        unread_command_buf = 0;
                } else {
@@ -1782,10 +1780,6 @@ static int read_next_command(void)
                        rc->prev->next = rc;
                        cmd_tail = rc;
                }
-               if (skip_prefix(command_buf.buf, "get-mark ", &p)) {
-                       parse_get_mark(p);
-                       continue;
-               }
                if (command_buf.buf[0] == '#')
                        continue;
                return 0;
@@ -3318,6 +3312,8 @@ int cmd_main(int argc, const char **argv)
                        parse_ls(v, NULL);
                else if (skip_prefix(command_buf.buf, "cat-blob ", &v))
                        parse_cat_blob(v);
+               else if (skip_prefix(command_buf.buf, "get-mark ", &v))
+                       parse_get_mark(v);
                else if (!strcmp("checkpoint", command_buf.buf))
                        parse_checkpoint();
                else if (!strcmp("done", command_buf.buf))