From c1572bb5ec4540b5008490cf471cc4a5e65ef728 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sat, 31 Mar 2018 14:20:01 +0100 Subject: Add "snapshot-prefix" repo configuration Allow using a user-specified value for the prefix in snapshot files instead of the repository basename. For example, files downloaded from the linux-stable.git repository should be named linux-$VERSION and not linux-stable-$VERSION, which can be achieved by setting: repo.snapshot-prefix=linux Signed-off-by: John Keeping Reviewed-by: Christian Hesse --- cgit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index bd9cb3f..d2f7b9c 100644 --- a/cgit.c +++ b/cgit.c @@ -79,6 +79,8 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va item->util = xstrdup(value); } else if (!strcmp(name, "section")) repo->section = xstrdup(value); + else if (!strcmp(name, "snapshot-prefix")) + repo->snapshot_prefix = xstrdup(value); else if (!strcmp(name, "readme") && value != NULL) { if (repo->readme.items == ctx.cfg.readme.items) memset(&repo->readme, 0, sizeof(repo->readme)); -- cgit v1.2.3-59-g8ed1b