isomorphic-git: can't clone gists
I followed the API and apparently I can’t clone gists.
This is my code:
await git.clone({
fs,
dir: '/tmp/test',
ref: 'master',
url: 'https://gist.github.com/f55e5fc30238c672621f56aba653904c.git'
})
It does clone the gist repo but only populates it with the .git
directory. I could then git.pull
to get the file too but that’s not how cloning works.
If I use the isomorphic-git repo address as url
it works as expected.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (14 by maintainers)
Commits related to this issue
- fix: Include 'User-Agent' during ref discovery phase (fixes #247) (#248) * fix: Include 'User-Agent' during ref discovery phase (required to clone gists) * chore: Update all-contributors — committed to modesty/isomorphic-git by billiegoose 6 years ago
- fix: Actually set User-Agent string in browser (fix #247) (PR #257) — committed to modesty/isomorphic-git by billiegoose 6 years ago
In chrome you can’t even use XHR to set
user-agent
. I’ve delete fetch before including isomorphic-git so it get xhr instead of fetch and I’ve got errorrequest.js:194 Refused to set unsafe header "user-agent"
.Will set up my proxy to include that user-agent. thanks for the tip.
great, works as expected now. Thank you.
🎉 This issue has been resolved in version 0.17.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
Confirmed. For some reason, Github is returning 404 Not Found errors for service discovery attempts requests to gists if the
User-Agent
string does not start withgit/
. Regular Github repos only require the User-Agent string for the second HTTP request which does the actual cloning. I guess we’ll need to send the User-Agent for both of them. 😕