aboutsummaryrefslogtreecommitdiff
path: root/remote_url.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
commit71ab9b7f14118f02dd18cd733bd4e0ad19ece590 (patch)
tree0303cbee651a4e1cee62a348d25066b9543f4425 /remote_url.go
parentgit2d: Remove UTF-8 checks (diff)
downloadforge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.gz
forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.zst
forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.zip
config shall no longer be a global variable
Diffstat (limited to 'remote_url.go')
-rw-r--r--remote_url.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/remote_url.go b/remote_url.go
index f227dbf..9f30993 100644
--- a/remote_url.go
+++ b/remote_url.go
@@ -14,12 +14,12 @@ import (
// genSSHRemoteURL generates SSH remote URLs from a given group path and repo
// name.
-func genSSHRemoteURL(groupPath []string, repoName string) string {
- return strings.TrimSuffix(config.SSH.Root, "/") + "/" + misc.SegmentsToURL(groupPath) + "/-/repos/" + url.PathEscape(repoName)
+func (s *server) genSSHRemoteURL(groupPath []string, repoName string) string {
+ return strings.TrimSuffix(s.config.SSH.Root, "/") + "/" + misc.SegmentsToURL(groupPath) + "/-/repos/" + url.PathEscape(repoName)
}
// genHTTPRemoteURL generates HTTP remote URLs from a given group path and repo
// name.
-func genHTTPRemoteURL(groupPath []string, repoName string) string {
- return strings.TrimSuffix(config.HTTP.Root, "/") + "/" + misc.SegmentsToURL(groupPath) + "/-/repos/" + url.PathEscape(repoName)
+func (s *server) genHTTPRemoteURL(groupPath []string, repoName string) string {
+ return strings.TrimSuffix(s.config.HTTP.Root, "/") + "/" + misc.SegmentsToURL(groupPath) + "/-/repos/" + url.PathEscape(repoName)
}