Diff options
-rw-r--r--source/cgit.c4
1 file changed, 3 insertions, 1 deletion
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");