If you're getting a bunch of stuff with curl from GitHub can't you just use curl to get the patches directly from github?
Append .patch to the end of a pr or commit and it spits out the mbox formatted patch.
https://github.com/jiphex/mbox/commit/f139c575e306a1691a31d8...