[PATCH 4/6] Don't display graph page if enable-commit-graph is not set to "separate"

Kian Kasad kian at kasad.com
Fri Aug 5 04:59:37 UTC 2022


If the graph page is not supposed to be enabled, it returns a "404 Not
Found" error page.
---
 cmd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmd.c b/cmd.c
index c780895..6940b60 100644
--- a/cmd.c
+++ b/cmd.c
@@ -107,6 +107,8 @@ static void log_fn(void)
 
 static void graph_fn(void)
 {
+	if (ctx.repo->enable_commit_graph != 2)
+		return cgit_print_error_page(404, "Not found", "Not found");
 	cgit_print_log(ctx.qry.oid, ctx.qry.ofs, ctx.cfg.max_commit_count,
 		       ctx.qry.grep, ctx.qry.search, ctx.qry.path, 1,
 		       (ctx.repo->enable_commit_graph == 2) ? 2 : 0,
-- 
2.37.1



More information about the CGit mailing list