diff options
author | Unknwon <u@gogs.io> | 2015-03-11 09:21:05 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-03-11 09:21:05 -0400 |
commit | 34102f788945b1c73a845f7916d01d216baa56ad (patch) | |
tree | 002d4110061db82569347ceb18ffdf6b24a1dffd /routers | |
parent | da6fd93f0db157410efb1824dfc4b1f8102a6c47 (diff) | |
download | gitea-34102f788945b1c73a845f7916d01d216baa56ad.tar.gz gitea-34102f788945b1c73a845f7916d01d216baa56ad.zip |
remove unused scripts and simplify migrate form definition
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo.go | 6 | ||||
-rw-r--r-- | routers/repo/repo.go | 6 |
2 files changed, 6 insertions, 6 deletions
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) { |