diff options
author | Unknwon <u@gogs.io> | 2015-12-08 20:06:12 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-08 20:06:12 -0500 |
commit | 120cd4e4716d11f79a7e8c41c066383e579d480a (patch) | |
tree | b25ae1b31ecf5437250c388d55ee940e294a4187 /modules/auth/repo_form.go | |
parent | 1cbd4c01fbfd4e15e36a722c9e2cc19366be3df8 (diff) | |
download | gitea-120cd4e4716d11f79a7e8c41c066383e579d480a.tar.gz gitea-120cd4e4716d11f79a7e8c41c066383e579d480a.zip |
#1984 Better mirror repo management
Diffstat (limited to 'modules/auth/repo_form.go')
-rw-r--r-- | modules/auth/repo_form.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 2629f4414f..90115d80f2 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -69,6 +69,9 @@ func (f MigrateRepoForm) ParseRemoteAddr(user *models.User) (string, error) { } if len(f.AuthUsername)+len(f.AuthPassword) > 0 { u.User = url.UserPassword(f.AuthUsername, f.AuthPassword) + } else { + // Fake user name and password to prevent prompt and fail quick. + u.User = url.UserPassword("fake_user", "") } remoteAddr = u.String() } else if !user.CanImportLocal() { @@ -81,12 +84,13 @@ func (f MigrateRepoForm) ParseRemoteAddr(user *models.User) (string, error) { } type RepoSettingForm struct { - RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` - Description string `binding:"MaxSize(255)"` - Website string `binding:"Url;MaxSize(100)"` - Branch string - Interval int - Private bool + RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` + Description string `binding:"MaxSize(255)"` + Website string `binding:"Url;MaxSize(100)"` + Branch string + Interval int + MirrorAddress string + Private bool // Advanced settings EnableWiki bool |