diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-06-12 07:43:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-12 13:43:27 +0800 |
commit | edf14202fea349500d69ed2a360a53cc0d1f80e3 (patch) | |
tree | 2702b4bd827d1c7c5a8384115ec28e73128fa88a /services | |
parent | 3898fc5bdafa33432d8ee9841e09b5c8b372df12 (diff) | |
download | gitea-edf14202fea349500d69ed2a360a53cc0d1f80e3.tar.gz gitea-edf14202fea349500d69ed2a360a53cc0d1f80e3.zip |
Unify repo settings & show better error (#19828)
* Unify context data
* Actually show invalid url in error
Diffstat (limited to 'services')
-rw-r--r-- | services/forms/repo_form.go | 2 | ||||
-rw-r--r-- | services/migrations/migrate.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go index 738a77d2bb..23ac1abe3c 100644 --- a/services/forms/repo_form.go +++ b/services/forms/repo_form.go @@ -101,7 +101,7 @@ func ParseRemoteAddr(remoteAddr, authUsername, authPassword string) (string, err strings.HasPrefix(remoteAddr, "git://") { u, err := url.Parse(remoteAddr) if err != nil { - return "", &models.ErrInvalidCloneAddr{IsURLError: true} + return "", &models.ErrInvalidCloneAddr{IsURLError: true, Host: remoteAddr} } if len(authUsername)+len(authPassword) > 0 { u.User = url.UserPassword(authUsername, authPassword) diff --git a/services/migrations/migrate.go b/services/migrations/migrate.go index 700f06af35..ce76733bd5 100644 --- a/services/migrations/migrate.go +++ b/services/migrations/migrate.go @@ -44,7 +44,7 @@ func IsMigrateURLAllowed(remoteURL string, doer *user_model.User) error { // Remote address can be HTTP/HTTPS/Git URL or local path. u, err := url.Parse(remoteURL) if err != nil { - return &models.ErrInvalidCloneAddr{IsURLError: true} + return &models.ErrInvalidCloneAddr{IsURLError: true, Host: remoteURL} } if u.Scheme == "file" || u.Scheme == "" { |