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:
@@ -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