1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Merge pull request #2624 from mhartkorn/convert-mirror-to-repo

Convert mirrors to regular repositories
This commit is contained in:
Unknwon
2016-02-15 14:26:21 -05:00
4 changed files with 116 additions and 24 deletions

View File

@@ -655,7 +655,12 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
return repo, UpdateRepository(repo, false)
}
if err = createUpdateHook(repoPath); err != nil {
return CleanUpMigrateInfo(repo, repoPath)
}
// Finish migrating repository with things that don't need to be done for mirrors.
func CleanUpMigrateInfo(repo *Repository, repoPath string) (*Repository, error) {
if err := createUpdateHook(repoPath); err != nil {
return repo, fmt.Errorf("createUpdateHook: %v", err)
}
@@ -1615,6 +1620,11 @@ func MirrorUpdate() {
}
}
func DeleteMirrorByRepoID(repoId int64) error {
_, err := x.Delete(&Mirror{RepoID: repoId})
return err
}
// GitFsck calls 'git fsck' to check repository health.
func GitFsck() {
if taskStatusPool.IsRunning(_GIT_FSCK) {