summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorMartin Hartkorn <github@hartkorn.net>2016-02-14 21:12:00 +0100
committerMartin Hartkorn <github@hartkorn.net>2016-02-14 21:12:00 +0100
commit3650bd8528a8c0f43eb3d9083939735bf740fa3b (patch)
tree267f881bfb964101b66aef2973d8e27c440ffd41 /models
parent10e4887b2bf2e201c7acc38f09731a218ae1a7bc (diff)
downloadgitea-3650bd8528a8c0f43eb3d9083939735bf740fa3b.tar.gz
gitea-3650bd8528a8c0f43eb3d9083939735bf740fa3b.zip
Convert mirrors to regular repositories.
Diffstat (limited to 'models')
-rw-r--r--models/repo.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go
index fec007c9cc..71493810f2 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -654,7 +654,17 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
return repo, UpdateRepository(repo, false)
}
- if err = createUpdateHook(repoPath); err != nil {
+ repo, err = FinishMigrateRepository(repo, repoPath)
+ if err != nil {
+ return repo, err
+ }
+
+ return repo, UpdateRepository(repo, false)
+}
+
+// Finish migrating repository with things that don't need to be done for mirrors.
+func FinishMigrateRepository(repo *Repository, repoPath string) (*Repository, error) {
+ if err := createUpdateHook(repoPath); err != nil {
return repo, fmt.Errorf("createUpdateHook: %v", err)
}
@@ -695,7 +705,7 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
repo.DefaultBranch = headBranch.Name
}
- return repo, UpdateRepository(repo, false)
+ return repo, nil
}
// initRepoCommit temporarily changes with work directory.