소스 검색

Merge pull request #1105 from linquize/migrate-git

Allow to migrate through git:// protocol
无闻 10 년 전
부모
커밋
f7219b0cf0
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      routers/repo/repo.go

+ 2 - 2
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