mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Merge pull request #2624 from mhartkorn/convert-mirror-to-repo
Convert mirrors to regular repositories
This commit is contained in:
commit
dc89c51f3e
4 changed files with 116 additions and 24 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue