From 1615b3c1874932c08d504fcc111f46105a2207b6 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 20 Nov 2019 12:01:09 -0600 Subject: [PATCH] Hide given credentials for migrated repos. (#9097) CloneAddr was being saved as OriginalURL. Now passing OriginalURL through from the form and saving it in it's place --- models/task.go | 2 +- routers/repo/repo.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/models/task.go b/models/task.go index cb878d387c1..763644e0392 100644 --- a/models/task.go +++ b/models/task.go @@ -196,7 +196,7 @@ func CreateMigrateTask(doer, u *User, opts base.MigrateOptions) (*Task, error) { repo, err := CreateRepository(doer, u, CreateRepoOptions{ Name: opts.RepoName, Description: opts.Description, - OriginalURL: opts.CloneAddr, + OriginalURL: opts.OriginalURL, IsPrivate: opts.Private, IsMirror: opts.Mirror, Status: RepositoryBeingMigrated, diff --git a/routers/repo/repo.go b/routers/repo/repo.go index b78dd5376ee..e4bc6d24432 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -326,6 +326,7 @@ func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) { } var opts = migrations.MigrateOptions{ + OriginalURL: form.CloneAddr, CloneAddr: remoteAddr, RepoName: form.RepoName, Description: form.Description,