diff options
author | zeripath <art27@cantab.net> | 2022-03-28 20:48:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-28 21:48:41 +0200 |
commit | e69b7a92ed91a4b078d216581a24497a72363494 (patch) | |
tree | a46682f38082fb024e0053aaec5b0838ff64aeb8 /routers | |
parent | 54961f3ac97709238710b2207e8c42f0a9897d80 (diff) | |
download | gitea-e69b7a92ed91a4b078d216581a24497a72363494.tar.gz gitea-e69b7a92ed91a4b078d216581a24497a72363494.zip |
Allow API to create file on empty repo (#19224)
This PR adds the necessary work to make it possible to create files on empty
repos using the API.
Fix #10993
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/file.go | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go index 37781f79c9..6b3f653c95 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -233,9 +233,6 @@ func CreateFile(ctx *context.APIContext) { // "$ref": "#/responses/error" apiOpts := web.GetForm(ctx).(*api.CreateFileOptions) - if ctx.Repo.Repository.IsEmpty { - ctx.Error(http.StatusUnprocessableEntity, "RepoIsEmpty", fmt.Errorf("repo is empty")) - } if apiOpts.BranchName == "" { apiOpts.BranchName = ctx.Repo.Repository.DefaultBranch |