Skip to content

Commit e709bc1

Browse files
authored
Differentiate between push and pull mirror sync in progress (#27390)
Previously, if you had both a push and a pull mirror, the message did not clarify if you've accidentally synchronized the wrong one. Additionally fixed two typos that were encountered while debugging. ## Screenshots ![grafik](https://github.com/go-gitea/gitea/assets/51889757/164d5d20-728d-4365-9cb5-c37e95857cdf) ![grafik](https://github.com/go-gitea/gitea/assets/51889757/90bfffd2-abd4-4847-b8e2-db4231700a6d)
1 parent caef9f9 commit e709bc1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

options/locale/locale_en-US.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,8 @@ settings.mirror_settings.push_mirror.add = Add Push Mirror
20092009
settings.mirror_settings.push_mirror.edit_sync_time = Edit mirror sync interval
20102010

20112011
settings.sync_mirror = Synchronize Now
2012-
settings.mirror_sync_in_progress = Mirror synchronization is in progress. Check back in a minute.
2012+
settings.pull_mirror_sync_in_progress = Pulling changes from the remote %s at the moment.
2013+
settings.push_mirror_sync_in_progress = Pushing changes to the remote %s at the moment.
20132014
settings.site = Website
20142015
settings.update_settings = Update Settings
20152016
settings.update_mirror_settings = Update Mirror Settings

routers/web/repo/setting/setting.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func SettingsPost(ctx *context.Context) {
285285

286286
mirror_service.AddPullMirrorToQueue(repo.ID)
287287

288-
ctx.Flash.Info(ctx.Tr("repo.settings.mirror_sync_in_progress"))
288+
ctx.Flash.Info(ctx.Tr("repo.settings.pull_mirror_sync_in_progress", repo.OriginalURL))
289289
ctx.Redirect(repo.Link() + "/settings")
290290

291291
case "push-mirror-sync":
@@ -302,7 +302,7 @@ func SettingsPost(ctx *context.Context) {
302302

303303
mirror_service.AddPushMirrorToQueue(m.ID)
304304

305-
ctx.Flash.Info(ctx.Tr("repo.settings.mirror_sync_in_progress"))
305+
ctx.Flash.Info(ctx.Tr("repo.settings.push_mirror_sync_in_progress", m.RemoteAddress))
306306
ctx.Redirect(repo.Link() + "/settings")
307307

308308
case "push-mirror-update":

services/mirror/mirror_pull.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ func checkAndUpdateEmptyRepository(m *repo_model.Mirror, gitRepo *git.Repository
592592
if err := gitRepo.SetDefaultBranch(m.Repo.DefaultBranch); err != nil {
593593
if !git.IsErrUnsupportedVersion(err) {
594594
log.Error("Failed to update default branch of underlying git repository %-v. Error: %v", m.Repo, err)
595-
desc := fmt.Sprintf("Failed to uupdate default branch of underlying git repository '%s': %v", m.Repo.RepoPath(), err)
595+
desc := fmt.Sprintf("Failed to update default branch of underlying git repository '%s': %v", m.Repo.RepoPath(), err)
596596
if err = system_model.CreateRepositoryNotice(desc); err != nil {
597597
log.Error("CreateRepositoryNotice: %v", err)
598598
}
@@ -603,7 +603,7 @@ func checkAndUpdateEmptyRepository(m *repo_model.Mirror, gitRepo *git.Repository
603603
// Update the is empty and default_branch columns
604604
if err := repo_model.UpdateRepositoryCols(db.DefaultContext, m.Repo, "default_branch", "is_empty"); err != nil {
605605
log.Error("Failed to update default branch of repository %-v. Error: %v", m.Repo, err)
606-
desc := fmt.Sprintf("Failed to uupdate default branch of repository '%s': %v", m.Repo.RepoPath(), err)
606+
desc := fmt.Sprintf("Failed to update default branch of repository '%s': %v", m.Repo.RepoPath(), err)
607607
if err = system_model.CreateRepositoryNotice(desc); err != nil {
608608
log.Error("CreateRepositoryNotice: %v", err)
609609
}

0 commit comments

Comments
 (0)