Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: unable to post a first file to the empty repository #14633

Closed
d-lunyov opened this issue Feb 10, 2021 · 2 comments · Fixed by #24357
Closed

API: unable to post a first file to the empty repository #14633

d-lunyov opened this issue Feb 10, 2021 · 2 comments · Fixed by #24357
Labels
modifies/api This PR adds API routes or modifies them

Comments

@d-lunyov
Copy link

Repository was created with an API call createCurrentUserRepo and parameter "auto_init" set to false.

After that I want to create a first commit with README.md file, with the repoCreateFile request:
POST http://localhost:3000/api/v1/repos/lunik/apiRepoTest1/contents/README.md
with the next body:
{ "content":"aGVsbG8==", "message": "initial" }

I've got the next response (also this is illegal JSON):

{"message":"repo is empty","url":"http://localhost:3000/api/swagger"}
{"message":"illegal base64 data at input byte 8","url":"http://localhost:3000/api/swagger"}

@delvh
Copy link
Member

delvh commented Feb 12, 2021

This is somewhat related to #6918, I'd say: The ability to create files on an empty repository (using the web interface).
There however, the API most likely did not get updated as well to allow for that. I'll ask there whether a) it has already been fixed b) that branch is the correct branch for that or whether c) a new branch should be opened for this.

@delvh
Copy link
Member

delvh commented Feb 13, 2021

Okay, as it seems, this issue will be blocked until #6918 has been merged.
Afterwards, it should be simple to fix.

@lunny lunny added the modifies/api This PR adds API routes or modifies them label Feb 15, 2021
techknowlogick pushed a commit that referenced this issue Apr 27, 2023
The uploading API already works (the only nit is the the IsEmpty flag is
out-of-sync, this PR also fixes it)

Close #14633
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants