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/api | |
parent | da6fd93f0db157410efb1824dfc4b1f8102a6c47 (diff) | |
download | gitea-34102f788945b1c73a845f7916d01d216baa56ad.tar.gz gitea-34102f788945b1c73a845f7916d01d216baa56ad.zip |
remove unused scripts and simplify migrate form definition
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/repo.go | 6 |
1 files changed, 3 insertions, 3 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) { |