Thread (5 messages) flat view 5 messages, 1 author, 2016-06-15
DORMANTno replies

[PATCH 4/4] fast-import: only store commit objects

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:07
Subsystem: the rest · Maintainer: Linus Torvalds

There's no point in storing blob, they would increase the time of
loading the marks, and the vast majority of them will never be used
again.

This also makes fast-export and fast-import marks compatible.

Signed-off-by: Felipe Contreras <redacted>
---
 fast-import.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index e02f212..c583975 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1743,9 +1743,14 @@ static void dump_marks_helper(FILE *f,
 		}
 	} else {
 		for (k = 0; k < 1024; k++) {
-			if (m->data.marked[k])
+			if (m->data.marked[k]) {
+				struct object_entry *e;
+				e = m->data.marked[k];
+				if (e->type != OBJ_COMMIT)
+					continue;
 				fprintf(f, ":%" PRIuMAX " %s\n", base + k,
-					sha1_to_hex(m->data.marked[k]->idx.sha1));
+					sha1_to_hex(e->idx.sha1));
+			}
 		}
 	}
 }
-- 
1.8.3.rc0.401.g45bba44
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help