0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-19 00:11:24 +01:00

Add empty repo check in DetectAndHandleSchedules (#29606) (#29659)

Backport #29606
This commit is contained in:
yp05327 2024-03-08 18:50:04 +09:00 committed by GitHub
parent 6651d2d87a
commit bd7de0c4e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -459,6 +459,10 @@ func handleSchedules(
// DetectAndHandleSchedules detects the schedule workflows on the default branch and create schedule tasks
func DetectAndHandleSchedules(ctx context.Context, repo *repo_model.Repository) error {
if repo.IsEmpty {
return nil
}
gitRepo, err := git.OpenRepository(context.Background(), repo.RepoPath())
if err != nil {
return fmt.Errorf("git.OpenRepository: %w", err)