summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-03-25 08:43:07 -0400
committerUnknwon <u@gogs.io>2015-03-25 08:43:07 -0400
commit5169a0e025d5e250b9bd3b8a194ab7dc6dde32a3 (patch)
treebda0058cda9fdb5d0708967ebb721ba52f65377a
parentab896ecf2548ed5ac411c37c38875ad3a8127c65 (diff)
downloadgitea-5169a0e025d5e250b9bd3b8a194ab7dc6dde32a3.tar.gz
gitea-5169a0e025d5e250b9bd3b8a194ab7dc6dde32a3.zip
mirror fix of #1105
-rw-r--r--gogs.go2
-rw-r--r--routers/api/v1/repo.go6
-rw-r--r--routers/repo/repo.go6
-rw-r--r--templates/.VERSION2
4 files changed, 11 insertions, 5 deletions
diff --git a/gogs.go b/gogs.go
index 7f12623e35..7fe0a38efd 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.6.1.0324 Beta"
+const APP_VER = "0.6.1.0325 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
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)
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index d61917a081..73c9277d94 100644
--- a/routers/repo/repo.go
+++ b/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.
+ // Note: remember to change api/v1/repo.go: MigrateRepo
+ // FIXME: merge these two functions with better error handling
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)
if err != nil {
ctx.Data["Err_CloneAddr"] = true
diff --git a/templates/.VERSION b/templates/.VERSION
index 8c1d7394e4..36310b561e 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.6.1.0324 Beta \ No newline at end of file
+0.6.1.0325 Beta \ No newline at end of file