aboutsummaryrefslogtreecommitdiffstats
path: root/object-name.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2025-09-04 19:58:25 +0200
committerJunio C Hamano <gitster@pobox.com>2025-09-04 13:25:46 -0700
commit069c15d256ed5308d09a7a16d64c8af2416bed58 (patch)
treecba47a4b72d0b6e068bb2b4fca121bf1a61aaac6 /object-name.c
parentMerge branch 'maint-2.47' into maint-2.48 (diff)
downloadgit-069c15d256ed5308d09a7a16d64c8af2416bed58.tar.gz
git-069c15d256ed5308d09a7a16d64c8af2416bed58.zip
object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter
Expose the expected type of the second parameter of extend_abbrev_len() instead of casting a void pointer internally. Just a single caller passes in a void pointer, the rest pass the correct type. Let the compiler help keeping it that way. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r--object-name.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/object-name.c b/object-name.c
index 88d1313028..6c6c38d3cc 100644
--- a/object-name.c
+++ b/object-name.c
@@ -691,10 +691,9 @@ static inline char get_hex_char_from_oid(const struct object_id *oid,
return hex[oid->hash[pos >> 1] & 0xf];
}
-static int extend_abbrev_len(const struct object_id *oid, void *cb_data)
+static int extend_abbrev_len(const struct object_id *oid,
+ struct min_abbrev_data *mad)
{
- struct min_abbrev_data *mad = cb_data;
-
unsigned int i = mad->init_len;
while (mad->hex[i] && mad->hex[i] == get_hex_char_from_oid(oid, i))
i++;