cgit

commit 78031f92b0ff064efa82065a3cf6020c1256a5fd

Author: Lars Hjemli <hjemli@gmail.com>

Fix search in repo index even if caching is enabled

The repository index page needed to include the querystring in the cache
filename.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>

 cgit.c | 4 +++-


diff --git a/cgit.c b/cgit.c
index 6ec763fc670d04af532eaa4570b474533d02081a..38b0ba5d0616d29f291a9017ec59cac5522cf4ff 100644
--- a/cgit.c
+++ b/cgit.c
@@ -179,7 +179,9 @@ 		return 0;
 	}
 
 	if (!ctx.repo) {
-		item->name = xstrdup(fmt("%s/index.html", ctx.cfg.cache_root));
+		item->name = xstrdup(fmt("%s/index.%s.html",
+					 ctx.cfg.cache_root,
+					 cache_safe_filename(ctx.qry.raw)));
 		item->ttl = ctx.cfg.cache_root_ttl;
 		return 1;
 	}