From 10e5cfbe13138edcb1f2b6fc08c0f744d3decbcf Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:17:38 -0700 Subject: Mark the static pages in the command table The table already records what each page needs, and a second list of page names in cgit.c had to be kept in step with it by hand. --- source/cmd.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/cmd.c') diff --git a/source/cmd.c b/source/cmd.c index 676e144..7470c1d 100644 --- a/source/cmd.c +++ b/source/cmd.c @@ -159,24 +159,24 @@ static const struct cgit_cmd commands[] = { { .name = "HEAD", .fn = cgit_clone_head, .want_repo = 1, .is_clone = 1 }, { .name = "about", .fn = about_fn }, { .name = "atom", .fn = atom_fn, .want_repo = 1 }, - { .name = "blame", .fn = blame_fn, .want_repo = 1, .want_vpath = 1 }, - { .name = "blob", .fn = blob_fn, .want_repo = 1 }, - { .name = "commit", .fn = commit_fn, .want_repo = 1, .want_vpath = 1 }, - { .name = "diff", .fn = diff_fn, .want_repo = 1, .want_vpath = 1 }, + { .name = "blame", .fn = blame_fn, .want_repo = 1, .want_vpath = 1, .is_static = 1 }, + { .name = "blob", .fn = blob_fn, .want_repo = 1, .is_static = 1 }, + { .name = "commit", .fn = commit_fn, .want_repo = 1, .want_vpath = 1, .is_static = 1 }, + { .name = "diff", .fn = diff_fn, .want_repo = 1, .want_vpath = 1, .is_static = 1 }, { .name = "info", .fn = cgit_clone_info, .want_repo = 1, .is_clone = 1 }, { .name = "log", .fn = log_fn, .want_repo = 1, .want_vpath = 1 }, { .name = "ls_cache", .fn = ls_cache_fn }, { .name = "objects", .fn = cgit_clone_objects, .want_repo = 1, .is_clone = 1 }, - { .name = "patch", .fn = patch_fn, .want_repo = 1, .want_vpath = 1 }, - { .name = "plain", .fn = cgit_print_plain, .want_repo = 1 }, - { .name = "rawdiff", .fn = rawdiff_fn, .want_repo = 1, .want_vpath = 1 }, + { .name = "patch", .fn = patch_fn, .want_repo = 1, .want_vpath = 1, .is_static = 1 }, + { .name = "plain", .fn = cgit_print_plain, .want_repo = 1, .is_static = 1 }, + { .name = "rawdiff", .fn = rawdiff_fn, .want_repo = 1, .want_vpath = 1, .is_static = 1 }, { .name = "refs", .fn = refs_fn, .want_repo = 1 }, { .name = "repolist", .fn = cgit_print_repolist }, - { .name = "snapshot", .fn = snapshot_fn, .want_repo = 1 }, + { .name = "snapshot", .fn = snapshot_fn, .want_repo = 1, .is_static = 1 }, { .name = "stats", .fn = stats_fn, .want_repo = 1, .want_vpath = 1 }, { .name = "summary", .fn = cgit_print_summary, .want_repo = 1 }, - { .name = "tag", .fn = tag_fn, .want_repo = 1 }, - { .name = "tree", .fn = tree_fn, .want_repo = 1, .want_vpath = 1 }, + { .name = "tag", .fn = tag_fn, .want_repo = 1, .is_static = 1 }, + { .name = "tree", .fn = tree_fn, .want_repo = 1, .want_vpath = 1, .is_static = 1 }, }; const struct cgit_cmd *cgit_find_cmd(const char *name) -- cgit