From: Jeff King Date: Thu, 2 Apr 2026 04:14:51 +0000 (-0400) Subject: http: add const to fix strchr() warnings X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fb6a18782ff8f2d97b44c8812f9027f3812f970;p=thirdparty%2Fgit.git http: add const to fix strchr() warnings The "path" field of a "struct repo" (a custom http-push struct, not to be confused with "struct repository) is a pointer into a const argv string, and is never written to. The compiler does not traditionally complain about assigning from a const pointer because it happens via strchr(). But with some C23 libc versions (notably recent glibc), it has started to do so. Let's mark the field as const to silence the warnings. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/http-push.c b/http-push.c index 9ae6062198..96df6344ee 100644 --- a/http-push.c +++ b/http-push.c @@ -99,7 +99,7 @@ static struct object_list *objects; struct repo { char *url; - char *path; + const char *path; int path_len; int has_info_refs; int can_update_info_refs;