diff options
author | Unknwon <u@gogs.io> | 2015-03-25 08:43:07 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-03-25 08:43:07 -0400 |
commit | 5169a0e025d5e250b9bd3b8a194ab7dc6dde32a3 (patch) | |
tree | bda0058cda9fdb5d0708967ebb721ba52f65377a /routers/api | |
parent | ab896ecf2548ed5ac411c37c38875ad3a8127c65 (diff) | |
download | gitea-5169a0e025d5e250b9bd3b8a194ab7dc6dde32a3.tar.gz gitea-5169a0e025d5e250b9bd3b8a194ab7dc6dde32a3.zip |
mirror fix of #1105
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/repo.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/api/v1/repo.go b/routers/api/v1/repo.go index 6bb78ba018..d7cc5955ab 100644 --- a/routers/api/v1/repo.go +++ b/routers/api/v1/repo.go @@ -196,9 +196,11 @@ func MigrateRepo(ctx *middleware.Context, form auth.MigrateRepoForm) { } } - // Remote address can be HTTP/HTTPS URL or local path. + // Remote address can be HTTP/HTTPS/Git URL or local path. remoteAddr := form.CloneAddr - if strings.HasPrefix(form.CloneAddr, "http") { + if strings.HasPrefix(form.CloneAddr, "http://") || + strings.HasPrefix(form.CloneAddr, "https://") || + strings.HasPrefix(form.CloneAddr, "git://") { u, err := url.Parse(form.CloneAddr) if err != nil { ctx.HandleAPI(422, err) |