fast-import: Fix crash when referencing already existing objects
[gitweb.git] / fast-import.c
index 03f5ca7998a16203e72a15ee1f167fcfe8102861..f308db76300986ce46abe7df60c6f9c73b50234a 100644 (file)
@@ -1013,7 +1013,7 @@ static void load_tree(struct tree_entry *root)
                return;
 
        myoe = find_object(sha1);
-       if (myoe) {
+       if (myoe && myoe->pack_id != MAX_PACK_ID) {
                if (myoe->type != OBJ_TREE)
                        die("Not a tree: %s", sha1_to_hex(sha1));
                t->delta_depth = 0;