@matheusbsbs / matheus-bagliano / commits / 20f546a86c
Fork 0

fast-import: Fix crash when referencing already existing objects

Commit a5c1780a0355a71b9fb70f1f1977ce726ee5b8d8 sets the pack_id of existing objects to MAX_PACK_ID. When the same object is referenced later again it is found in the local object hash. With such a pack_id fast-import should not try to locate that object in the newly created pack(s). Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Simon Hausmann committed May 23, 2007 at 23:01 UTC 20f546a86c5c673fc49050479a12edfb9f8672bf
1 file changed +1 -1
fast-import.c
+1 -1
@@ -1013,7 +1013,7 @@ static void load_tree(struct tree_entry *root)
1013 return;
1014
1015 myoe = find_object(sha1);
1016 - if (myoe) {
1016 + if (myoe && myoe->pack_id != MAX_PACK_ID) {
1017 if (myoe->type != OBJ_TREE)
1018 die("Not a tree: %s", sha1_to_hex(sha1));
1019 t->delta_depth = 0;