Merge pull request #1105 from linquize/migrate-git

Allow to migrate through git:// protocol
release/v1.15
无闻 2015-03-24 19:28:55 -04:00
commit f7219b0cf0
1 changed files with 2 additions and 2 deletions

View File

@ -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