1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-26 20:28:40 +00:00

Correctly adjust mirror url (#6593) (#6594)

This commit is contained in:
zeripath
2019-04-12 22:25:06 +01:00
committed by GitHub
parent a63b9fbc70
commit 40f41dc694
5 changed files with 70 additions and 15 deletions

View File

@@ -1077,9 +1077,11 @@ func CleanUpMigrateInfo(repo *Repository) (*Repository, error) {
}
}
if err := cleanUpMigrateGitConfig(repo.GitConfigPath()); err != nil {
return repo, fmt.Errorf("cleanUpMigrateGitConfig: %v", err)
_, err := git.NewCommand("remote", "remove", "origin").RunInDir(repoPath)
if err != nil && !strings.HasPrefix(err.Error(), "exit status 128 - fatal: No such remote ") {
return repo, fmt.Errorf("CleanUpMigrateInfo: %v", err)
}
if repo.HasWiki() {
if err := cleanUpMigrateGitConfig(path.Join(repo.WikiPath(), "config")); err != nil {
return repo, fmt.Errorf("cleanUpMigrateGitConfig (wiki): %v", err)