diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-06 15:17:57 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-06 20:07:48 +0800 |
commit | 8ed0dbe4201a58b00d6f3743178f4cbe5328e2b0 (patch) | |
tree | a2f33fccac42b554b1176741d00c1d0cd2d0dceb /remote_url.go | |
parent | sql: Add purge and test scripts (diff) | |
download | forge-8ed0dbe4201a58b00d6f3743178f4cbe5328e2b0.tar.gz forge-8ed0dbe4201a58b00d6f3743178f4cbe5328e2b0.tar.zst forge-8ed0dbe4201a58b00d6f3743178f4cbe5328e2b0.zip |
*: Support subgroups via SQL recursion
Diffstat (limited to 'remote_url.go')
-rw-r--r-- | remote_url.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/remote_url.go b/remote_url.go index e478324..506e35c 100644 --- a/remote_url.go +++ b/remote_url.go @@ -10,10 +10,10 @@ import ( // We don't use path.Join because it collapses multiple slashes into one. -func generate_ssh_remote_url(group_name, repo_name string) string { - return strings.TrimSuffix(config.SSH.Root, "/") + "/" + url.PathEscape(group_name) + "/:/repos/" + url.PathEscape(repo_name) +func generate_ssh_remote_url(group_path []string, repo_name string) string { + return strings.TrimSuffix(config.SSH.Root, "/") + "/" + path_escape_cat_segments(group_path) + "/:/repos/" + url.PathEscape(repo_name) } -func generate_http_remote_url(group_name, repo_name string) string { - return strings.TrimSuffix(config.HTTP.Root, "/") + "/" + url.PathEscape(group_name) + "/:/repos/" + url.PathEscape(repo_name) +func generate_http_remote_url(group_path []string, repo_name string) string { + return strings.TrimSuffix(config.HTTP.Root, "/") + "/" + path_escape_cat_segments(group_path) + "/:/repos/" + url.PathEscape(repo_name) } |