GITEA should update the wiki repository remote origin while update the repository mirror address #5631

Closed
opened 2025-11-02 06:31:26 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @yisiliang on GitHub (Jun 25, 2020).

  1. Create -> New Migration.
  2. Migration Type: This repository will be a mirror.
  3. Create wiki on the original repository.
  4. Sync from original repository to the mirror repository.
  5. Update "Clone From URL" from Repo -> Settings -> Mirror Settings.
  6. Click "Synchronize Now" button, there will be a failed message the gitea.log
    Failed to update mirror repository wiki
    
  • Gitea version (or commit ref): v1.12.1
  • Git version: 2.24.3
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

It should update the wiki repository remote origin while update the repository mirror address.
Below is the source code of save mirror address, I think update the wiki repository remote origin is missing.

// SaveAddress writes new address to Git repository config.
func SaveAddress(m *models.Mirror, addr string) error {
	repoPath := m.Repo.RepoPath()
	// Remove old origin
	_, err := git.NewCommand("remote", "rm", "origin").RunInDir(repoPath)
	if err != nil && !strings.HasPrefix(err.Error(), "exit status 128 - fatal: No such remote ") {
		return err
	}

	_, err = git.NewCommand("remote", "add", "origin", "--mirror=fetch", addr).RunInDir(repoPath)
	return err
}
Originally created by @yisiliang on GitHub (Jun 25, 2020). 1. Create -> New Migration. 2. Migration Type: This repository will be a mirror. 3. Create wiki on the original repository. 4. Sync from original repository to the mirror repository. 5. Update "Clone From URL" from Repo -> Settings -> Mirror Settings. 6. Click "Synchronize Now" button, there will be a failed message the gitea.log ``` Failed to update mirror repository wiki ``` - Gitea version (or commit ref): v1.12.1 - Git version: 2.24.3 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant ## Description It should update the wiki repository remote origin while update the repository mirror address. Below is the source code of save mirror address, I think update the wiki repository remote origin is missing. ```go // SaveAddress writes new address to Git repository config. func SaveAddress(m *models.Mirror, addr string) error { repoPath := m.Repo.RepoPath() // Remove old origin _, err := git.NewCommand("remote", "rm", "origin").RunInDir(repoPath) if err != nil && !strings.HasPrefix(err.Error(), "exit status 128 - fatal: No such remote ") { return err } _, err = git.NewCommand("remote", "add", "origin", "--mirror=fetch", addr).RunInDir(repoPath) return err } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5631