Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bsmth/gh-api-reproducer
Fetching commits via gh api
https://github.com/bsmth/gh-api-reproducer
Last synced: 25 days ago
JSON representation
Fetching commits via gh api
- Host: GitHub
- URL: https://github.com/bsmth/gh-api-reproducer
- Owner: bsmth
- Created: 2023-08-11T07:24:25.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-11T07:46:04.000Z (about 1 year ago)
- Last Synced: 2023-08-11T14:57:14.601Z (about 1 year ago)
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gh-api-reproducer
Fetching commits via gh api
## Test chars
- 🇮🇪
- : Flag emoji
- �
- : Unicode replacement character HTML entity
- �
- : Unicode replacement character
## Steps to reproduce
Use the `gh` cli to fetch commits from this repo:
```bash
gh api repos/bsmth/gh-api-reproducer/commits/81d0f58fbadb176ccfd292240b87e474f4b5c848
# invalid UTF-8 string
```## Expected result
A full JSON response is returned:
```json
{
// ...
"files": [
{
// ...
"patch": "@@ -1,3 +1,5 @@\n []: # Path: README.md\n # gh-api-reproducer\n \n+Fetching commits via gh api\n+\n ## Test chars\n \n - �\n - : Unicode replacement character\n ..."
// ...
}
```## Actual result
JSON output is truncated / broken at the `patch` key at the point where the character is encountered:
```json
{
// ...
"patch": "@@ -1,3 +1,5 @@\n []: # Path: README.md\n # gh-api-reproducer\n \n+Fetching commits via gh api\n+\n ## Test chars\n \n -
```## Example passing command
If the patch is parsed correctly, we can get the patch contents:
```bash
gh api repos/bsmth/gh-api-reproducer/commits/1b33e078374c5d3e596c16ea4a02c735191b21ec --jq '.files[].patch'
```