Skip to content

Commit e092efd

Browse files
committed
remove dep to gogs
1 parent ebd9fb2 commit e092efd

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

submodule.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
package git
66

7-
import (
8-
"strings"
9-
10-
"github.com/gogits/gogs/modules/setting"
11-
)
7+
import "strings"
128

139
type SubModule struct {
1410
Name string
@@ -33,7 +29,7 @@ func NewSubModuleFile(c *Commit, refUrl, refId string) *SubModuleFile {
3329

3430
// FIXME: remove import of setting
3531
// RefUrl guesses and returns reference URL.
36-
func (sf *SubModuleFile) RefUrl() string {
32+
func (sf *SubModuleFile) RefUrl(urlPrefix string) string {
3733
if sf.refUrl == "" {
3834
return ""
3935
}
@@ -55,8 +51,8 @@ func (sf *SubModuleFile) RefUrl() string {
5551
j := strings.LastIndex(url, ":")
5652
if i > -1 && j > -1 {
5753
// fix problem with reverse proxy works only with local server
58-
if strings.Contains(setting.AppUrl, url[i+1:j]) {
59-
return setting.AppUrl + url[j+1:]
54+
if strings.Contains(urlPrefix, url[i+1:j]) {
55+
return urlPrefix + url[j+1:]
6056
} else {
6157
return "http://" + url[i+1:j] + "/" + url[j+1:]
6258
}

0 commit comments

Comments
 (0)