def latest_sha(self, differs_from=''):
        # If-None-Match returns 200 instead of 304 value does not have quotes
        headers = {
            'Accept': 'application/vnd.github.chitauri-preview+sha',
            'If-None-Match': '"{0}"'.format(differs_from)
        }
        base = self._api.split('/branches', 1)[0]
        url = self._build_url('commits', self.name, base_url=base)
        resp = self._get(url, headers=headers)
        if self._boolean(resp, 200, 304):
            return resp.content
        return None
Check if SHA-1 is the same as remote branch
dataset/ETHPy150Open sigmavirus24/github3.py/github3/repos/branch.py/Branch.latest_sha