SyncRepositoryHooks rewrites all repositories' pre-receive, update and post-receive hooks to make sure the binary and custom conf path are up-to-date.
()
| 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. |
| 2052 | func 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. |
| 2068 | var taskStatusTable = sync.NewStatusTable() |