From 821b552305b2afccee092ac08863ba4058badc72 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 06:21:33 -1000 Subject: Keep string literals behind const pointers Git's DEVELOPER=1 build turns on -Wwrite-strings as an error, and the literals stored through plain char pointers failed cgit's own objects there. The exec filter's argv takes the cast execvp needs once, the way git's run-command does. --- source/cgit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/cgit.c') diff --git a/source/cgit.c b/source/cgit.c index 8dc90e6..2ef4cf1 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -1010,7 +1010,7 @@ static char *guess_defbranch(void) ref = refs_resolve_ref_unsafe(get_main_ref_store(the_repository), "HEAD", 0, &oid, NULL); if (!ref || !skip_prefix(ref, "refs/heads/", &refname)) - return "master"; + return xstrdup("master"); return xstrdup(refname); } -- cgit