1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

remove unused scripts and simplify migrate form definition

This commit is contained in:
Unknwon
2015-03-11 09:21:05 -04:00
parent da6fd93f0d
commit 34102f7889
8 changed files with 17 additions and 40 deletions

View File

@@ -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) {