diff options
-rw-r--r-- | scan-tree.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scan-tree.c b/scan-tree.c index 044bcdc..e900ad9 100644 --- a/scan-tree.c +++ b/scan-tree.c | |||
@@ -123,9 +123,12 @@ static void add_repo(const char *base, struct strbuf *path, repo_config_fn fn) | |||
123 | strbuf_setlen(path, pathlen); | 123 | strbuf_setlen(path, pathlen); |
124 | } | 124 | } |
125 | 125 | ||
126 | if (ctx.cfg.remove_suffix) | 126 | if (ctx.cfg.remove_suffix) { |
127 | if ((p = strrchr(repo->url, '.')) && !strcmp(p, ".git")) | 127 | size_t urllen; |
128 | *p = '\0'; | 128 | strip_suffix(repo->url, ".git", &urllen); |
129 | strip_suffix_mem(repo->url, &urllen, "/"); | ||
130 | repo->url[urllen] = '\0'; | ||
131 | } | ||
129 | repo->path = xstrdup(path->buf); | 132 | repo->path = xstrdup(path->buf); |
130 | while (!repo->owner) { | 133 | while (!repo->owner) { |
131 | if ((pwd = getpwuid(st.st_uid)) == NULL) { | 134 | if ((pwd = getpwuid(st.st_uid)) == NULL) { |