|
|
|
@ -654,12 +654,7 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
|
|
|
|
|
return repo, UpdateRepository(repo, false) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
repo, err = CleanUpMigrateInfo(repo, repoPath) |
|
|
|
|
if err != nil { |
|
|
|
|
return repo, err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return repo, UpdateRepository(repo, false) |
|
|
|
|
return CleanUpMigrateInfo(repo, repoPath) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Finish migrating repository with things that don't need to be done for mirrors.
|
|
|
|
@ -705,7 +700,7 @@ func CleanUpMigrateInfo(repo *Repository, repoPath string) (*Repository, error)
|
|
|
|
|
repo.DefaultBranch = headBranch.Name |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return repo, nil |
|
|
|
|
return repo, UpdateRepository(repo, false) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// initRepoCommit temporarily changes with work directory.
|
|
|
|
@ -1622,6 +1617,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) { |
|
|
|
|