diff options
author | lstahlman <luke.stahlman@gmail.com> | 2016-07-16 18:30:43 -0700 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-07-17 09:30:43 +0800 |
commit | 25b3836418cda78be79c17c4fa58571f7fbd5a8d (patch) | |
tree | a651f68a9e657f30dc91d08759f6395e0d29fd22 | |
parent | 5aa2bf86f4cb9b3c6c472a3f8f1db10331f27c65 (diff) | |
download | gitea-25b3836418cda78be79c17c4fa58571f7fbd5a8d.tar.gz gitea-25b3836418cda78be79c17c4fa58571f7fbd5a8d.zip |
Refresh repository mirror from database when the repository's name has changed. (#3276)
-rw-r--r-- | routers/repo/setting.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index c9236a5331..c5772dca52 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -105,6 +105,15 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { } if repo.IsMirror { + if isNameChanged { + var err error + ctx.Repo.Mirror, err = models.GetMirror(repo.ID) + if err != nil { + ctx.Handle(500, "RefreshRepositoryMirror", err) + return + } + } + if form.Interval > 0 { ctx.Repo.Mirror.EnablePrune = form.EnablePrune ctx.Repo.Mirror.Interval = form.Interval |