summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-14 20:54:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-14 20:54:22 (GMT)
commit78e67cda42a440f216fc4cbfd8a9e190c5eece5a (patch)
tree6e1f8349af8dc8ba249a6fd9f4367ef8e983a55d /object.c
parentdf04a316176d5ba44422c2c6b0cb1a9fc31901e5 (diff)
parentb98d18858187eb926912d5199533a6d2a14d5007 (diff)
downloadgit-78e67cda42a440f216fc4cbfd8a9e190c5eece5a.zip
git-78e67cda42a440f216fc4cbfd8a9e190c5eece5a.tar.gz
git-78e67cda42a440f216fc4cbfd8a9e190c5eece5a.tar.bz2
Merge branch 'mt/use-passed-repo-more-in-funcs'
Some codepaths were given a repository instance as a parameter to work in the repository, but passed the_repository instance to its callees, which has been cleaned up (somewhat). * mt/use-passed-repo-more-in-funcs: sha1-file: allow check_object_signature() to handle any repo sha1-file: pass git_hash_algo to hash_object_file() sha1-file: pass git_hash_algo to write_object_file_prepare() streaming: allow open_istream() to handle any repo pack-check: use given repo's hash_algo at verify_packfile() cache-tree: use given repo's hash_algo at verify_one() diff: make diff_populate_filespec() honor its repo argument
Diffstat (limited to 'object.c')
-rw-r--r--object.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/object.c b/object.c
index b4e1d3d..c94be94 100644
--- a/object.c
+++ b/object.c
@@ -262,7 +262,7 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
if ((obj && obj->type == OBJ_BLOB && repo_has_object_file(r, oid)) ||
(!obj && repo_has_object_file(r, oid) &&
oid_object_info(r, oid, NULL) == OBJ_BLOB)) {
- if (check_object_signature(repl, NULL, 0, NULL) < 0) {
+ if (check_object_signature(r, repl, NULL, 0, NULL) < 0) {
error(_("hash mismatch %s"), oid_to_hex(oid));
return NULL;
}
@@ -272,7 +272,8 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
buffer = repo_read_object_file(r, oid, &type, &size);
if (buffer) {
- if (check_object_signature(repl, buffer, size, type_name(type)) < 0) {
+ if (check_object_signature(r, repl, buffer, size,
+ type_name(type)) < 0) {
free(buffer);
error(_("hash mismatch %s"), oid_to_hex(repl));
return NULL;