From 34102f788945b1c73a845f7916d01d216baa56ad Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 11 Mar 2015 09:21:05 -0400 Subject: remove unused scripts and simplify migrate form definition --- routers/api/v1/repo.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'routers/api') 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) { -- cgit v1.2.3