@@ -737,3 +737,27 @@ func (c GitHubClient) ListFiles(ctx context.Context, owner, repo, path, ref stri
737737
738738 return dirContents , nil
739739}
740+
741+ // CompareCommits fetches the differences between two commits
742+ func (c GitHubClient ) CompareCommits (ctx context.Context , owner , repo , base , head string , opts * github.ListOptions ) (* github.CommitsComparison , error ) {
743+ comparison , resp , err := c .inner .Repositories .CompareCommits (
744+ ctx , owner , repo , base , head , opts ,
745+ )
746+ if err := validateResponse (ctx , err , resp , fmt .Sprintf ("compare commits %s...%s" , base , head )); err != nil {
747+ return nil , err
748+ }
749+
750+ return comparison , nil
751+ }
752+
753+ // GetCommitDetails fetches the details of a single commit
754+ func (c GitHubClient ) GetCommitDetails (ctx context.Context , owner , repo , sha string , opts * github.ListOptions ) (* github.RepositoryCommit , error ) {
755+ cDetails , resp , err := c .inner .Repositories .GetCommit (
756+ ctx , owner , repo , sha , opts ,
757+ )
758+ if err := validateResponse (ctx , err , resp , fmt .Sprintf ("get commit details for %s" , sha )); err != nil {
759+ return nil , err
760+ }
761+
762+ return cDetails , nil
763+ }
0 commit comments