Handle ssh urls
This commit is contained in:
parent
4248de4fec
commit
c7b35e451f
@ -3,6 +3,7 @@ package gitmedia
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,6 +28,11 @@ func (c *Configuration) RemoteEndpoint(remote string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if url, ok := c.GitConfig("remote." + remote + ".url"); ok {
|
if url, ok := c.GitConfig("remote." + remote + ".url"); ok {
|
||||||
|
if !strings.HasPrefix(url, "https://") {
|
||||||
|
re := regexp.MustCompile("^.+@")
|
||||||
|
url = re.ReplaceAllLiteralString(url, "https://")
|
||||||
|
}
|
||||||
|
|
||||||
if path.Ext(url) == ".git" {
|
if path.Ext(url) == ".git" {
|
||||||
return url + "/info/media"
|
return url + "/info/media"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user