chore: document that the file APIs expect the git blob SHA, also for LFS files - #38915
Open
lunny wants to merge 1 commit into
Open
chore: document that the file APIs expect the git blob SHA, also for LFS files#38915lunny wants to merge 1 commit into
lunny wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
shaaccepted by the file APIs (PUT /repos/{owner}/{repo}/contents/{filepath},DELETE /repos/{owner}/{repo}/contents/{filepath}andPOST /repos/{owner}/{repo}/contents) is compared against the ID of the blob the tree entry points at:https://github.com/go-gitea/gitea/blob/main/services/repository/files/update.go#L381-L389
For a file tracked by Git LFS the committed blob is the pointer file, so the value to send is the ID of that pointer blob (the
shathe "Get contents" API returns), not thelfs_oidof the LFS object and not a checksum of the file content. Sending the LFS object ID fails withsha does not match, which is hard to figure out from the current descriptions, they only say "the blob ID (SHA) for the file".This adds that to the swagger comments of
shainDeleteFileOptions,UpdateFileOptionsandChangeFileOperation, and pointsContentsResponse.shaat the file APIs, so the two ends of the workflow reference each other. No behaviour change, only comments and the regenerated specs.Reported at https://gitea.com/gitea/docs/issues/243