1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Support uploading file to empty repo by API (#24357)

The uploading API already works (the only nit is the the IsEmpty flag is
out-of-sync, this PR also fixes it)

Close #14633
This commit is contained in:
wxiaoguang
2023-04-27 09:36:26 +08:00
committed by GitHub
parent de265f3771
commit cf465b4721
2 changed files with 38 additions and 0 deletions

View File

@@ -458,6 +458,11 @@ func CreateOrUpdateRepoFile(ctx context.Context, repo *repo_model.Repository, do
if err != nil {
return nil, err
}
if repo.IsEmpty {
_ = repo_model.UpdateRepositoryCols(ctx, &repo_model.Repository{ID: repo.ID, IsEmpty: false}, "is_empty")
}
return file, nil
}