diff mbox series

[v2,05/11] object API: correct "buf" v.s. "map" mismatch in *.c and *.h

Message ID patch-v2-05.11-207aec4eb64-20220204T135005Z-avarab@gmail.com (mailing list archive)
State Superseded
Headers show
Series object-file API: pass object enums, tidy up streaming interface | expand

Commit Message

Ævar Arnfjörð Bjarmason Feb. 4, 2022, 1:51 p.m. UTC
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>
---
 object-file.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Junio C Hamano Feb. 4, 2022, 8:54 p.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> 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

Double dot X-<.
diff mbox series

Patch

diff --git a/object-file.c b/object-file.c
index 59eb793e0ac..271acf4dd15 100644
--- a/object-file.c
+++ b/object-file.c
@@ -1067,13 +1067,13 @@  int format_object_header(char *str, size_t size, enum object_type type,
 }
 
 /*
- * With an in-core object data in "map", rehash it to make sure the
+ * With in-core object data in "buf", rehash it to make sure the
  * object name actually matches "oid" to detect object corruption.
- * With "map" == NULL, try reading the object named with "oid" using
+ * With "buf" == NULL, try reading the object named with "oid" using
  * the streaming interface and rehash it to do the same.
  */
 int check_object_signature(struct repository *r, const struct object_id *oid,
-			   void *map, unsigned long size, const char *type,
+			   void *buf, unsigned long size, const char *type,
 			   struct object_id *real_oidp)
 {
 	struct object_id tmp;
@@ -1084,8 +1084,8 @@  int check_object_signature(struct repository *r, const struct object_id *oid,
 	char hdr[MAX_HEADER_LEN];
 	int hdrlen;
 
-	if (map) {
-		hash_object_file(r->hash_algo, map, size, type, real_oid);
+	if (buf) {
+		hash_object_file(r->hash_algo, buf, size, type, real_oid);
 		return !oideq(oid, real_oid) ? -1 : 0;
 	}