summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-04-12 21:52:57 +0100
committerGitHub <noreply@github.com>2019-04-12 21:52:57 +0100
commitb3e757a06c2cfc554c7db0e2da170b123404f058 (patch)
treeb5ff24cc87a1a51308132a11b192d459d1c6f957 /models/repo.go
parent01e0408fa1bf01094c40887ed8d58992459e3ba4 (diff)
downloadgitea-b3e757a06c2cfc554c7db0e2da170b123404f058.tar.gz
gitea-b3e757a06c2cfc554c7db0e2da170b123404f058.zip
Correctly adjust mirror url (#6593)
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go6
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)