From b3e757a06c2cfc554c7db0e2da170b123404f058 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 12 Apr 2019 21:52:57 +0100 Subject: Correctly adjust mirror url (#6593) --- models/repo.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'models/repo.go') diff --git a/models/repo.go b/models/repo.go index 8b51f14043..f180179440 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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) -- cgit v1.2.3