diff options
author | zeripath <art27@cantab.net> | 2019-04-12 21:52:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 21:52:57 +0100 |
commit | b3e757a06c2cfc554c7db0e2da170b123404f058 (patch) | |
tree | b5ff24cc87a1a51308132a11b192d459d1c6f957 /models/repo.go | |
parent | 01e0408fa1bf01094c40887ed8d58992459e3ba4 (diff) | |
download | gitea-b3e757a06c2cfc554c7db0e2da170b123404f058.tar.gz gitea-b3e757a06c2cfc554c7db0e2da170b123404f058.zip |
Correctly adjust mirror url (#6593)
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 6 |
1 files changed, 4 insertions, 2 deletions
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) |