1
0
Fork 0
forked from forgejo/forgejo

update code.gitea.io/git (#450)

This commit is contained in:
Lunny Xiao 2016-12-22 17:30:52 +08:00 committed by Thomas Boerger
parent 0c5c34d7dd
commit 47a7529d96
36 changed files with 509 additions and 480 deletions

View file

@ -6,6 +6,7 @@ package git
import "strings"
// SubModule submodule is a reference on git repository
type SubModule struct {
Name string
URL string
@ -19,6 +20,7 @@ type SubModuleFile struct {
refID string
}
// NewSubModuleFile create a new submodule file
func NewSubModuleFile(c *Commit, refURL, refID string) *SubModuleFile {
return &SubModuleFile{
Commit: c,
@ -64,9 +66,8 @@ func (sf *SubModuleFile) RefURL(urlPrefix string, parentPath string) string {
// fix problem with reverse proxy works only with local server
if strings.Contains(urlPrefix, url[i+1:j]) {
return urlPrefix + url[j+1:]
} else {
return "http://" + url[i+1:j] + "/" + url[j+1:]
}
return "http://" + url[i+1:j] + "/" + url[j+1:]
}
return url