code: func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) {
  	u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, url.QueryEscape(ref))
  
  	req, err := s.client.NewRequest("GET", u, nil)
  	if err != nil {
  		return "", nil, err
  	}
  	if lastSHA != "" {
  		req.Header.Set("If-None-Match", `"`+lastSHA+`"`)
  	}
  
  	req.Header.Set("Accept", mediaTypeV3SHA)
  
  	var buf bytes.Buffer
  	resp, err := s.client.Do(ctx, req, &buf)
  	if err != nil {
  		return "", resp, err
  	}
  
  	return buf.String(), resp, nil
  }
docs: // GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is
  // supplied and no new commits have occurred, a 304 Unmodified response is returned.
  //
  // GitHub API docs: https://developer.github.com/v3/repos/commits/#get-the-sha-1-of-a-commit-reference