summaryrefslogtreecommitdiffstats
path: root/sha1_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 777b8e8eae..6b74c7d3bc 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -3685,15 +3685,15 @@ static int for_each_file_in_obj_subdir(int subdir_nr,
strbuf_setlen(path, baselen);
strbuf_addf(path, "/%s", de->d_name);
- if (strlen(de->d_name) == 38) {
- char hex[41];
- unsigned char sha1[20];
+ if (strlen(de->d_name) == GIT_SHA1_HEXSZ - 2) {
+ char hex[GIT_SHA1_HEXSZ+1];
+ struct object_id oid;
snprintf(hex, sizeof(hex), "%02x%s",
subdir_nr, de->d_name);
- if (!get_sha1_hex(hex, sha1)) {
+ if (!get_oid_hex(hex, &oid)) {
if (obj_cb) {
- r = obj_cb(sha1, path->buf, data);
+ r = obj_cb(&oid, path->buf, data);
if (r)
break;
}
@@ -3805,7 +3805,7 @@ static int for_each_object_in_pack(struct packed_git *p, each_packed_object_fn c
return error("unable to get sha1 of object %u in %s",
i, p->pack_name);
- r = cb(oid.hash, p, i, data);
+ r = cb(&oid, p, i, data);
if (r)
break;
}