- die("failed to read delta-pack base object");
- result = patch_delta(base, base_size,
- delta_data, delta_size,
- &result_size);
- if (!result)
- die("failed to apply delta");
- free(delta_data);
-
- if (write_sha1_file(result, result_size, type, sha1) < 0)
- die("failed to write %s (%s)",
- sha1_to_hex(entry->sha1), type);
- free(result);
- printf("%s %s\n", sha1_to_hex(sha1), type);
- if (memcmp(sha1, entry->sha1, 20))
- die("resulting %s have wrong SHA1", type);
- return 0;
+ die("failed to read delta-pack base object %s", sha1_to_hex(base_sha1));
+ result = resolve_delta(type, base, base_size, delta_data, delta_size);
+ free(base);
+ return result;