mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-08-06 01:37:25 +08: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:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user