forked from kevadesu/forgejo
remove unused scripts and simplify migrate form definition
This commit is contained in:
parent
da6fd93f0d
commit
34102f7889
8 changed files with 17 additions and 40 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue