From 34102f788945b1c73a845f7916d01d216baa56ad Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 11 Mar 2015 09:21:05 -0400 Subject: [PATCH] remove unused scripts and simplify migrate form definition --- .gobuild.yml | 22 ---------------------- gogs.go | 2 +- modules/auth/repo_form.go | 14 +++++++------- routers/api/v1/repo.go | 6 +++--- routers/repo/repo.go | 6 +++--- templates/.VERSION | 2 +- templates/repo/migrate.tmpl | 4 ++-- wercker.yml | 1 - 8 files changed, 17 insertions(+), 40 deletions(-) delete mode 100644 .gobuild.yml delete mode 100644 wercker.yml diff --git a/.gobuild.yml b/.gobuild.yml deleted file mode 100644 index f1b9b691c3..0000000000 --- a/.gobuild.yml +++ /dev/null @@ -1,22 +0,0 @@ -filesets: - includes: - - conf - - etc - - public - - scripts - - templates - - LICENSE - - README.md - - README_ZH.md - excludes: - - \.git - depth: 5 -settings: - build: | - if test "$GOOS" = "windows" -a "$GOARCH" = "386" - then - go install -v - else - go get -v -tags "sqlite redis memcache cert" github.com/gogits/gogs - go install -v -tags "sqlite redis memcache cert" - fi diff --git a/gogs.go b/gogs.go index 7b212b72fd..2d34178d50 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.5.16.0301 Beta" +const APP_VER = "0.5.16.0311 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 2902a92f2e..a092830188 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -32,13 +32,13 @@ func (f *CreateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) bin type MigrateRepoForm struct { CloneAddr string `binding:"Required"` - AuthUserName string `form:"auth_username"` - AuthPasswd string `form:"auth_password"` - Uid int64 `form:"uid" binding:"Required"` - RepoName string `form:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"` - Mirror bool `form:"mirror"` - Private bool `form:"private"` - Description string `form:"desc" binding:"MaxSize(255)"` + AuthUsername string + AuthPassword string + Uid int64 `binding:"Required"` + RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` + Mirror bool + Private bool + Description string `binding:"MaxSize(255)"` } func (f *MigrateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { diff --git a/routers/api/v1/repo.go b/routers/api/v1/repo.go index eb9908911f..6bb78ba018 100644 --- a/routers/api/v1/repo.go +++ b/routers/api/v1/repo.go @@ -196,7 +196,7 @@ func MigrateRepo(ctx *middleware.Context, form auth.MigrateRepoForm) { } } - // Remote address can be HTTPS URL or local path. + // Remote address can be HTTP/HTTPS URL or local path. remoteAddr := form.CloneAddr if strings.HasPrefix(form.CloneAddr, "http") { u, err := url.Parse(form.CloneAddr) @@ -204,8 +204,8 @@ func MigrateRepo(ctx *middleware.Context, form auth.MigrateRepoForm) { ctx.HandleAPI(422, err) return } - if len(form.AuthUserName) > 0 || len(form.AuthPasswd) > 0 { - u.User = url.UserPassword(form.AuthUserName, form.AuthPasswd) + if len(form.AuthUsername) > 0 || len(form.AuthPassword) > 0 { + u.User = url.UserPassword(form.AuthUsername, form.AuthPassword) } remoteAddr = u.String() } else if !com.IsDir(remoteAddr) { diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 6b84a389d5..37d07c563f 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -181,7 +181,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { } } - // Remote address can be HTTPS URL or local path. + // Remote address can be HTTP/HTTPS URL or local path. remoteAddr := form.CloneAddr if strings.HasPrefix(form.CloneAddr, "http") { u, err := url.Parse(form.CloneAddr) @@ -190,8 +190,8 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { ctx.RenderWithErr(ctx.Tr("form.url_error"), MIGRATE, &form) return } - if len(form.AuthUserName) > 0 || len(form.AuthPasswd) > 0 { - u.User = url.UserPassword(form.AuthUserName, form.AuthPasswd) + if len(form.AuthUsername) > 0 || len(form.AuthPassword) > 0 { + u.User = url.UserPassword(form.AuthUsername, form.AuthPassword) } remoteAddr = u.String() } else if !com.IsDir(remoteAddr) { diff --git a/templates/.VERSION b/templates/.VERSION index bc7ed7d030..cd8bf82a6b 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.5.16.0301 Beta \ No newline at end of file +0.5.16.0311 Beta \ No newline at end of file diff --git a/templates/repo/migrate.tmpl b/templates/repo/migrate.tmpl index 5869be1558..cc23888db2 100644 --- a/templates/repo/migrate.tmpl +++ b/templates/repo/migrate.tmpl @@ -68,8 +68,8 @@ {{.i18n.Tr "repo.migrate_type_helper" | Str2html}}
- - + +
diff --git a/wercker.yml b/wercker.yml deleted file mode 100644 index 7c64bf0a91..0000000000 --- a/wercker.yml +++ /dev/null @@ -1 +0,0 @@ -box: wercker/default