diff options
author | Martin Hartkorn <github@hartkorn.net> | 2016-02-14 22:40:39 +0100 |
---|---|---|
committer | Martin Hartkorn <github@hartkorn.net> | 2016-02-14 22:40:39 +0100 |
commit | 15d37b7a95829e7551d843925fb034bbc613b8f2 (patch) | |
tree | 1eb40439feed2385a90271dca00065fbc73a6787 /routers | |
parent | 15394f613f7c03d23903d75f12ba018b3b76dffa (diff) | |
download | gitea-15d37b7a95829e7551d843925fb034bbc613b8f2.tar.gz gitea-15d37b7a95829e7551d843925fb034bbc613b8f2.zip |
Refactored according to suggestions
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/setting.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 690e7a4652..cb541fc98e 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -158,19 +158,18 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) { ctx.Error(404) return } - repo.IsMirror = false - if _, err := models.FinishMigrateRepository(repo, models.RepoPath(ctx.Repo.Owner.Name, repo.Name)); err != nil { + if _, err := models.CleanUpMigrateInfo(repo, models.RepoPath(ctx.Repo.Owner.Name, repo.Name)); err != nil { ctx.RenderWithErr(ctx.Tr("settings.convert.failed"), SETTINGS_OPTIONS, &form) return } - if err := models.UpdateRepository(repo, false); err != nil { + if err := models.UpdateRepository(repo, false); err != nil { ctx.RenderWithErr(ctx.Tr("settings.convert.failed"), SETTINGS_OPTIONS, &form) return } - log.Trace("Repository converted: %s/%s", ctx.Repo.Owner.Name, repo.Name) + log.Trace("Repository converted from mirror to regular: %s/%s", ctx.Repo.Owner.Name, repo.Name) ctx.Flash.Success(ctx.Tr("repo.settings.convert_succeed")) ctx.Redirect(setting.AppSubUrl + "/" + ctx.Repo.Owner.Name + "/" + repo.Name) |