MCPcopy Create free account
hub / github.com/gogs/gogs / SyncRepositoryHooks

Function SyncRepositoryHooks

internal/database/repo.go:2052–2065  ·  view source on GitHub ↗

SyncRepositoryHooks rewrites all repositories' pre-receive, update and post-receive hooks to make sure the binary and custom conf path are up-to-date.

()

Source from the content-addressed store, hash-verified

2050// SyncRepositoryHooks rewrites all repositories' pre-receive, update and post-receive hooks
2051// to make sure the binary and custom conf path are up-to-date.
2052func SyncRepositoryHooks() error {
2053 return x.Where("id > 0").Iterate(new(Repository),
2054 func(idx int, bean any) error {
2055 repo := bean.(*Repository)
2056 if err := createDelegateHooks(repo.RepoPath()); err != nil {
2057 return err
2058 }
2059
2060 if repo.HasWiki() {
2061 return createDelegateHooks(repo.WikiPath())
2062 }
2063 return nil
2064 })
2065}
2066
2067// Prevent duplicate running tasks.
2068var taskStatusTable = sync.NewStatusTable()

Callers 1

OperationFunction · 0.92

Calls 6

createDelegateHooksFunction · 0.85
IterateMethod · 0.80
WhereMethod · 0.80
RepoPathMethod · 0.80
HasWikiMethod · 0.80
WikiPathMethod · 0.80

Tested by

no test coverage detected