diff --git a/builtin/fast-export.c b/builtin/fast-export.c index d60d675f6f5f1a2df50bdd3a6ba076e8c0ddd1f2..dd561e5031955b54c995abde1271c4841c3c7d24 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -613,6 +613,7 @@ static void import_marks(char *input_file) char *line_end, *mark_end; unsigned char sha1[20]; struct object *object; + enum object_type type; line_end = strchr(line, '\n'); if (line[0] != ':' || !line_end) @@ -627,17 +628,19 @@ static void import_marks(char *input_file) if (last_idnum < mark) last_idnum = mark; - object = parse_object(sha1); - if (!object) + type = sha1_object_info(sha1, NULL); + if (type < 0) + die("object not found: %s", sha1_to_hex(sha1)); + + if (type != OBJ_COMMIT) + /* only commits */ continue; + object = parse_object(sha1); + if (object->flags & SHOWN) error("Object %s already has a mark", sha1_to_hex(sha1)); - if (object->type != OBJ_COMMIT) - /* only commits */ - continue; - mark_object(object, mark); object->flags |= SHOWN;