diff options
Diffstat (limited to 'unpack-objects.c')
-rw-r--r-- | unpack-objects.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/unpack-objects.c b/unpack-objects.c index 0d15c00387..97d2681874 100644 --- a/unpack-objects.c +++ b/unpack-objects.c @@ -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; } @@ -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); |