Skip to content

Commit 47bd9bf

Browse files
felipecgitster
authored andcommitted
fast-export: don't parse commits while reading marks file
We don't need the parsed objects at this point, merely the information that they have marks. Seems to be three times faster in my setup with lots of objects. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e6812cf commit 47bd9bf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

builtin/fast-export.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ static void import_marks(char *input_file)
613613
char *line_end, *mark_end;
614614
unsigned char sha1[20];
615615
struct object *object;
616+
struct commit *commit;
616617
enum object_type type;
617618

618619
line_end = strchr(line, '\n');
@@ -636,7 +637,11 @@ static void import_marks(char *input_file)
636637
/* only commits */
637638
continue;
638639

639-
object = parse_object(sha1);
640+
commit = lookup_commit(sha1);
641+
if (!commit)
642+
die("not a commit? can't happen: %s", sha1_to_hex(sha1));
643+
644+
object = &commit->object;
640645

641646
if (object->flags & SHOWN)
642647
error("Object %s already has a mark", sha1_to_hex(sha1));

0 commit comments

Comments
 (0)