Skip to content

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

Closed
@yisiliang

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions