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 <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras committed
May 5, 2013 at 17:38 UTC
47bd9bf82daeac71b28a5a697ecc44e70b205e18
1 file changed
+6
-1
builtin/fast-export.c
+6
-1
@@ -613,6 +613,7 @@ static void import_marks(char *input_file)
613
char *line_end, *mark_end;
614
unsigned char sha1[20];
615
struct object *object;
616
+ struct commit *commit;
617
enum object_type type;
618
619
line_end = strchr(line, '\n');
@@ -636,7 +637,11 @@ static void import_marks(char *input_file)
637
/* only commits */
638
continue;
639
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;
645
646
if (object->flags & SHOWN)
647
error("Object %s already has a mark", sha1_to_hex(sha1));