path: root/builtin/index-pack.c
diff options
authorMatheus Tavares <>2020-01-30 20:32:22 (GMT)
committerJunio C Hamano <>2020-01-31 18:45:39 (GMT)
commit2dcde20e1c55fc2e3f9e9e6d48e93c39ec5661d2 (patch)
tree9039d3dd520e915bf531c8f2f32190a4a87d9ccd /builtin/index-pack.c
parent7ad5c44d9ce559703245d389aa71c4445dc9359c (diff)
sha1-file: pass git_hash_algo to hash_object_file()
Allow hash_object_file() to work on arbitrary repos by introducing a git_hash_algo parameter. Change callers which have a struct repository pointer in their scope to pass on the git_hash_algo from the said repo. For all other callers, pass on the_hash_algo, which was already being used internally at hash_object_file(). This functionality will be used in the following patch to make check_object_signature() be able to work on arbitrary repos (which, in turn, will be used to fix an inconsistency at object.c:parse_object()). Signed-off-by: Matheus Tavares <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/index-pack.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 7a08da8..0183610 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -949,7 +949,7 @@ static void resolve_delta(struct object_entry *delta_obj,
if (!result->data)
bad_object(delta_obj->idx.offset, _("failed to apply delta"));
- hash_object_file(result->data, result->size,
+ hash_object_file(the_hash_algo, result->data, result->size,
type_name(delta_obj->real_type), &delta_obj->idx.oid);
sha1_object(result->data, NULL, result->size, delta_obj->real_type,