mirror of
https://git.zx2c4.com/cgit
synced 2025-07-31 08:04:28 +02:00
Add support for 'remove-suffix' option
When this option is enabled, the '.git' suffix of repository directories found while processing the 'scan-path' option will be removed. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
parent
3516502aa0
commit
2e4a941626
4 changed files with 13 additions and 0 deletions
|
@ -81,6 +81,9 @@ static void add_repo(const char *base, const char *path, repo_config_fn fn)
|
|||
p[strlen(p) - 5] = '\0';
|
||||
|
||||
repo = cgit_add_repo(xstrdup(p));
|
||||
if (ctx.cfg.remove_suffix)
|
||||
if ((p = strrchr(repo->url, '.')) && !strcmp(p, ".git"))
|
||||
*p = '\0';
|
||||
repo->name = repo->url;
|
||||
repo->path = xstrdup(path);
|
||||
p = (pwd && pwd->pw_gecos) ? strchr(pwd->pw_gecos, ',') : NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue