1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-23 17:53:10 +00:00

Refresh repository mirror from database when the repository's name has changed. (#3276)

This commit is contained in:
lstahlman 2016-07-16 18:30:43 -07:00 committed by 无闻
parent 5aa2bf86f4
commit 25b3836418

View file

@ -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