From 3a977fc0aee71bee29cebd3d373091751e94241f Mon Sep 17 00:00:00 2001 From: Linquize Date: Fri, 20 Mar 2015 21:52:49 +0800 Subject: [PATCH] Allow to migrate through git:// protocol --- routers/repo/repo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 8884bea3ab7..d61917a0811 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -181,9 +181,9 @@ func MigratePost(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.Data["Err_CloneAddr"] = true