Some small refactors (#36163)

This commit is contained in:
Lunny Xiao
2025-12-15 11:55:44 -08:00
committed by GitHub
parent 26602fd207
commit da087270ff
6 changed files with 11 additions and 14 deletions

View File

@@ -257,7 +257,7 @@ func CheckDaemonExportOK(ctx context.Context, repo *repo_model.Repository) error
isPublic := !repo.IsPrivate && repo.Owner.Visibility == structs.VisibleTypePublic
if !isPublic && isExist {
if err = gitrepo.RemoveRepoFile(ctx, repo, daemonExportFile); err != nil {
if err = gitrepo.RemoveRepoFileOrDir(ctx, repo, daemonExportFile); err != nil {
log.Error("Failed to remove %s: %v", daemonExportFile, err)
}
} else if isPublic && !isExist {