Skip to content

Commit

Permalink
fast-import: Fix crash when referencing already existing objects
Browse files Browse the repository at this point in the history
Commit a5c1780 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>
  • Loading branch information
Simon Hausmann authored and Shawn O. Pearce committed May 24, 2007
1 parent b259157 commit 20f546a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 20f546a

Please sign in to comment.