content API update and some other features #113
Closed
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.
Instead of using read/write, the content API should be used unless the data is more than 1MB, because the number of http requests get reduced from 3 to just 1, and allows multi-user commits which tracks the document SHA (prevents update with a old SHA).
A few changes to allow 4 things:
fix for issue Fix the contents function on the repository API. #101
getting Content(branch, path, cb, sync, 'json') will get a json with file obj sha, which is closer to what http://developer.github.com/v3/repos/contents/#get-contents is describing, with option 'json' will give the same behaviour as before, getting the file raw content
added a repo.req function to allow access to request, which is useful if anyone wants to make custom API calls
allow request status==0 which is returned from XHR request made from a locally loaded page
getCommits should use pagination