Refactor server code (#407)

هذا الالتزام موجود في:
Thomas Miceli
2025-01-20 01:57:39 +01:00
ملتزم من قبل GitHub
الأصل 4c5a7bda63
التزام f935ee1a7e
69 ملفات معدلة مع 4357 إضافات و3337 حذوفات

عرض الملف

@@ -141,17 +141,8 @@ func syncGistPreviews() {
func resetHooks() {
log.Info().Msg("Resetting Git server hooks for all repositories...")
entries, err := filepath.Glob(filepath.Join(config.GetHomeDir(), "repos", "*", "*"))
if err != nil {
log.Error().Err(err).Msg("Cannot read repos directories")
return
}
for _, e := range entries {
path := strings.Split(e, string(os.PathSeparator))
if err := git.CreateDotGitFiles(path[len(path)-2], path[len(path)-1]); err != nil {
log.Error().Err(err).Msgf("Cannot reset hooks for repository %s/%s", path[len(path)-2], path[len(path)-1])
}
if err := git.ResetHooks(); err != nil {
log.Error().Err(err).Msg("Error resetting hooks for repositories")
}
}