-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Unable to create empty file #2427
Copy link
Copy link
Closed
Description
When attempting to commit an empty file to a repository using ghClient.Repositories.CreateFile and passing in []byte{} under the Content field of a github.RepositoryContentFileOptions the GitHub API will return a 422 error stating that content was not supplied. This is most likely due to the line:
go-github/github/repos_contents.go
Line 54 in 7a7a7f0
| Content []byte `json:"content,omitempty"` // unencoded |
Which adds omitempty to the Content field of github.RepositoryContentFileOptions, even though it is a necessary field of the request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels