object API: correct "buf" v.s. "map" mismatch in *.c and *.h

Change the name of the second argument to check_object_signature() to be "buf" in object-file.c, making it consistent with the prototype in cache.h This fixes an inconsistency that's been with us since 2ade9340262 (Add "check_sha1_signature()" helper function, 2005-04-08), and makes a subsequent commit's diff smaller, as we'll move these API docs to cache.h. While we're at it fix a small grammar error in the documentation, dropping an "an" before "in-core object-data". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 5, 2022 at 00:48 UTC 73182b2d84e3348ab87ef5ecbe3315881381c29c
1 file changed +5 -5
object-file.c
+5 -5
@@ -1067,13 +1067,13 @@ int format_object_header(char *str, size_t size, enum object_type type,
1067 }
1068
1069 /*
1070 - * With an in-core object data in "map", rehash it to make sure the
1070 + * With in-core object data in "buf", rehash it to make sure the
1071 * object name actually matches "oid" to detect object corruption.
1072 - * With "map" == NULL, try reading the object named with "oid" using
1072 + * With "buf" == NULL, try reading the object named with "oid" using
1073 * the streaming interface and rehash it to do the same.
1074 */
1075 int check_object_signature(struct repository *r, const struct object_id *oid,
1076 - void *map, unsigned long size, const char *type,
1076 + void *buf, unsigned long size, const char *type,
1077 struct object_id *real_oidp)
1078 {
1079 struct object_id tmp;
@@ -1084,8 +1084,8 @@ int check_object_signature(struct repository *r, const struct object_id *oid,
1084 char hdr[MAX_HEADER_LEN];
1085 int hdrlen;
1086
1087 - if (map) {
1088 - hash_object_file(r->hash_algo, map, size, type, real_oid);
1087 + if (buf) {
1088 + hash_object_file(r->hash_algo, buf, size, type, real_oid);
1089 return !oideq(oid, real_oid) ? -1 : 0;
1090 }
1091