Skip to content

Commit

Permalink
Re-instate dry-run logic in git-unpack-objects
Browse files Browse the repository at this point in the history
It can no longer be as verbose, since it doesn't have a good way to
resolve deltas (now that it is purely streaming, it cannot seek around
to read the objects a delta is based on).

But it can check that the thing unpacks cleanly at least as far as pack
syntax goes - all the objects uncompress cleanly, and the pack has the
right final SHA1.
  • Loading branch information
Linus Torvalds committed Jun 29, 2005
1 parent cca7081 commit dddafff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion unpack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ static int unpack_non_delta_entry(enum object_type kind, unsigned long size)
case OBJ_TAG: type = "tag"; break;
default: die("bad type %d", kind);
}
write_object(buf, size, type);
if (!dry_run)
write_object(buf, size, type);
free(buf);
return 0;
}
Expand All @@ -171,6 +172,10 @@ static int unpack_delta_entry(unsigned long delta_size)
use(20);

delta_data = get_data(delta_size);
if (dry_run) {
free(delta_data);
return 0;
}

if (!has_sha1_file(base_sha1)) {
add_delta_to_list(base_sha1, delta_data, delta_size);
Expand Down

0 comments on commit dddafff

Please sign in to comment.