diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
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.
Diffstat (limited to 'source/cgit.c')
-rw-r--r--source/cgit.c2
1 file changed, 1 insertion, 1 deletion
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);
}