Skip to content

Commit 73182b2

Browse files
avargitster
authored andcommitted
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 2ade934 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c80d226 commit 73182b2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

object-file.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,13 +1067,13 @@ int format_object_header(char *str, size_t size, enum object_type type,
10671067
}
10681068

10691069
/*
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
10711071
* 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
10731073
* the streaming interface and rehash it to do the same.
10741074
*/
10751075
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,
10771077
struct object_id *real_oidp)
10781078
{
10791079
struct object_id tmp;
@@ -1084,8 +1084,8 @@ int check_object_signature(struct repository *r, const struct object_id *oid,
10841084
char hdr[MAX_HEADER_LEN];
10851085
int hdrlen;
10861086

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);
10891089
return !oideq(oid, real_oid) ? -1 : 0;
10901090
}
10911091

0 commit comments

Comments
 (0)