From cc99a4b63df18b0029bd861fed2e532c4d30b235 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 15:47:44 -0700 Subject: Reset the repository title before reusing it --- source/cgit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/cgit.c b/source/cgit.c index 38f30a0..f8795d7 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -1093,10 +1093,12 @@ static void open_repo(int *nongit, int *err) */ static int prepare_repo_cmd(int nongit, int err, int clone) { - // Static, since the pages replace the title without freeing it. + // Static, since the pages replace the title without freeing it. Reset + // on entry, since a failed cache fill renders the page a second time. static struct strbuf title = STRBUF_INIT; struct object_id oid; + strbuf_reset(&title); if (nongit) { const char *name = ctx.repo->name; strbuf_addf(&title, "%s - %s", ctx.cfg.root_title, "config error"); -- cgit