title: Github API: Check if a branch or repository contains a commit
body: <p>Can I use the Github API to check if a certain repository contains a certain commit?</p>
  
  <p>At first glance, it seems that <a href="https://developer.github.com/v3/repos/commits/#get-a-single-commit">the get a single commit</a> API call should work, returning 404 if there is no such commit in the repository. But that is not true: It seems that this call will run successful on commits that are present in forked repositories (possibly due to a pull request). (This effect can also be observed in the <a href="https://github.com/dspinellis/fileprune/commit/782da80c5862eb0845e8d65fe3e18e34862b512a">regular web interface</a>; this particular commit has not been pulled into that repository yet.)</p>