aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-17 22:37:38 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-17 22:37:38 +0800
commit52c8e56fe7da34a449ba0e497325f9cf27834721 (patch)
tree9607bbe7b822cb7243997b86dfb78e1f498d8df2
parentstyle.css: Make it more concise (diff)
downloadforge-52c8e56fe7da34a449ba0e497325f9cf27834721.tar.gz
forge-52c8e56fe7da34a449ba0e497325f9cf27834721.tar.zst
forge-52c8e56fe7da34a449ba0e497325f9cf27834721.zip
remote_url.go: Don't use path.Join (it strips :// into :/)
-rw-r--r--remote_url.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/remote_url.go b/remote_url.go
index 28d7dbe..f64d6ec 100644
--- a/remote_url.go
+++ b/remote_url.go
@@ -2,13 +2,13 @@ package main
import (
"net/url"
- "path"
+ "strings"
)
func generate_ssh_remote_url(group_name, repo_name string) string {
- return path.Join(config.SSH.Root, url.PathEscape(group_name), "/:/repos/", url.PathEscape(repo_name))
+ return strings.TrimSuffix(config.SSH.Root, "/") + "/" + url.PathEscape(group_name) + "/:/repos/" + url.PathEscape(repo_name)
}
func generate_http_remote_url(group_name, repo_name string) string {
- return path.Join(config.HTTP.Root, url.PathEscape(group_name), "/:/repos/", url.PathEscape(repo_name))
+ return strings.TrimSuffix(config.HTTP.Root, "/") + "/" + url.PathEscape(group_name) + "/:/repos/" + url.PathEscape(repo_name)
}