summaryrefslogtreecommitdiff
path: root/builtin/count-objects.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-02-21 23:47:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-22 18:12:15 (GMT)
commit76c1d9a09624ae39fa9e3140f6581e672b9c040a (patch)
treeb146b591ad3123bcb93f66787e216c4bfd630e1e /builtin/count-objects.c
parent068f85e31311f521adffbcbf96f6583206d77b7d (diff)
downloadgit-76c1d9a09624ae39fa9e3140f6581e672b9c040a.zip
git-76c1d9a09624ae39fa9e3140f6581e672b9c040a.tar.gz
git-76c1d9a09624ae39fa9e3140f6581e672b9c040a.tar.bz2
Convert object iteration callbacks to struct object_id
Convert each_loose_object_fn and each_packed_object_fn to take a pointer to struct object_id. Update the various callbacks. Convert several 40-based constants to use GIT_SHA1_HEXSZ. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/count-objects.c')
-rw-r--r--builtin/count-objects.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/count-objects.c b/builtin/count-objects.c
index a04b4f2..acb0594 100644
--- a/builtin/count-objects.c
+++ b/builtin/count-objects.c
@@ -53,7 +53,7 @@ static void loose_garbage(const char *path)
report_garbage(PACKDIR_FILE_GARBAGE, path);
}
-static int count_loose(const unsigned char *sha1, const char *path, void *data)
+static int count_loose(const struct object_id *oid, const char *path, void *data)
{
struct stat st;
@@ -62,7 +62,7 @@ static int count_loose(const unsigned char *sha1, const char *path, void *data)
else {
loose_size += on_disk_bytes(st);
loose++;
- if (verbose && has_sha1_pack(sha1))
+ if (verbose && has_sha1_pack(oid->hash))
packed_loose++;
}
return 0;