diff options
Diffstat (limited to 'ext/git/git.go')
| -rw-r--r-- | ext/git/git.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/git/git.go b/ext/git/git.go index 64d3587..b925789 100644 --- a/ext/git/git.go +++ b/ext/git/git.go @@ -26,6 +26,7 @@ var ( commitSHARegex = regexp.MustCompile("^[0-9A-Fa-f]{40}$") sshURLRegex = regexp.MustCompile("^(ssh://)?([^/:]*?)@[^@]+$") httpsURLRegex = regexp.MustCompile("^(https://).*") + httpURLRegex = regexp.MustCompile("^(http://).*") ) // IsCommitSHA returns whether or not a string is a 40 character SHA-1 @@ -84,9 +85,14 @@ func IsHTTPSURL(url string) bool { return httpsURLRegex.MatchString(url) } +// IsHTTPURL returns true if supplied URL is HTTP URL +func IsHTTPURL(url string) bool { + return httpURLRegex.MatchString(url) +} + // TestRepo tests if a repo exists and is accessible with the given credentials -func TestRepo(repo string, creds Creds, insecure bool, enableLfs bool) error { - clnt, err := NewClient(repo, creds, insecure, enableLfs) +func TestRepo(repo string, creds Creds, insecure bool, enableLfs bool, proxy string) error { + clnt, err := NewClient(repo, creds, insecure, enableLfs, proxy) if err != nil { return err } |
