mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Refactor repository check and sync functions (#9854)
Move more general repository functions out of models/repo.go
This commit is contained in:
parent
27c6b8fc07
commit
d92781bf94
12 changed files with 313 additions and 210 deletions
|
@ -17,6 +17,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/setting"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"gopkg.in/ini.v1"
|
||||
)
|
||||
|
||||
|
@ -156,11 +157,11 @@ func cleanUpMigrateGitConfig(configPath string) error {
|
|||
// CleanUpMigrateInfo finishes migrating repository and/or wiki with things that don't need to be done for mirrors.
|
||||
func CleanUpMigrateInfo(repo *models.Repository) (*models.Repository, error) {
|
||||
repoPath := repo.RepoPath()
|
||||
if err := models.CreateDelegateHooks(repoPath); err != nil {
|
||||
if err := createDelegateHooks(repoPath); err != nil {
|
||||
return repo, fmt.Errorf("createDelegateHooks: %v", err)
|
||||
}
|
||||
if repo.HasWiki() {
|
||||
if err := models.CreateDelegateHooks(repo.WikiPath()); err != nil {
|
||||
if err := createDelegateHooks(repo.WikiPath()); err != nil {
|
||||
return repo, fmt.Errorf("createDelegateHooks.(wiki): %v", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue