mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 16:38:42 +00:00
Remove trailing slash after remove-suffix
When removing the ".git" suffix of a non-bare repository, also remove the trailing slash for compatibility with cgit_repobasename(). Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
This commit is contained in:
parent
17838ec630
commit
485b09925c
@ -123,9 +123,12 @@ static void add_repo(const char *base, struct strbuf *path, repo_config_fn fn)
|
|||||||
strbuf_setlen(path, pathlen);
|
strbuf_setlen(path, pathlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx.cfg.remove_suffix)
|
if (ctx.cfg.remove_suffix) {
|
||||||
if ((p = strrchr(repo->url, '.')) && !strcmp(p, ".git"))
|
size_t urllen;
|
||||||
*p = '\0';
|
strip_suffix(repo->url, ".git", &urllen);
|
||||||
|
strip_suffix_mem(repo->url, &urllen, "/");
|
||||||
|
repo->url[urllen] = '\0';
|
||||||
|
}
|
||||||
repo->path = xstrdup(path->buf);
|
repo->path = xstrdup(path->buf);
|
||||||
while (!repo->owner) {
|
while (!repo->owner) {
|
||||||
if ((pwd = getpwuid(st.st_uid)) == NULL) {
|
if ((pwd = getpwuid(st.st_uid)) == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user