Browse Source

mirror fix of #1105

pull/1147/head
Unknwon 10 years ago
parent
commit
5169a0e025
  1. 2
      gogs.go
  2. 6
      routers/api/v1/repo.go
  3. 6
      routers/repo/repo.go
  4. 2
      templates/.VERSION

2
gogs.go

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.6.1.0324 Beta" const APP_VER = "0.6.1.0325 Beta"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

6
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 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) u, err := url.Parse(form.CloneAddr)
if err != nil { if err != nil {
ctx.HandleAPI(422, err) ctx.HandleAPI(422, err)

6
routers/repo/repo.go

@ -182,8 +182,12 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
} }
// Remote address can be HTTP/HTTPS/Git URL or local path. // Remote address can be HTTP/HTTPS/Git URL or local path.
// Note: remember to change api/v1/repo.go: MigrateRepo
// FIXME: merge these two functions with better error handling
remoteAddr := form.CloneAddr remoteAddr := form.CloneAddr
if strings.HasPrefix(form.CloneAddr, "http://") || strings.HasPrefix(form.CloneAddr, "https://") || strings.HasPrefix(form.CloneAddr, "git://") { if strings.HasPrefix(form.CloneAddr, "http://") ||
strings.HasPrefix(form.CloneAddr, "https://") ||
strings.HasPrefix(form.CloneAddr, "git://") {
u, err := url.Parse(form.CloneAddr) u, err := url.Parse(form.CloneAddr)
if err != nil { if err != nil {
ctx.Data["Err_CloneAddr"] = true ctx.Data["Err_CloneAddr"] = true

2
templates/.VERSION

@ -1 +1 @@
0.6.1.0324 Beta 0.6.1.0325 Beta
Loading…
Cancel
Save