@@ -497,26 +497,24 @@ def get_repo_details(self, repo):
497497 )
498498 return self ._make_request ('get' , f'repos/{ repo } ' )
499499
500- def get_commit_details (self , repo , since , branch = 'master' ):
500+ def get_commit_details (self , repo , since , branch = 'master' , path = None ):
501501 """
502- Retrieve a repository's commit details since a given date/time.
502+ Retrieve a repository branch 's commit details since a given date/time.
503503
504504 :param repo: the organization/repository as a string.
505505 :param since: the starting date/time as a datetime.
506506 :param branch: the branch as a string. Defaults to master.
507+ :param path: if provided, only commits for the path will be returned.
507508
508509 :returns: the repo branch's commit details since a given date/time.
509510 """
510511 self .session .headers .update (
511512 {'Accept' : 'application/vnd.github.v3+json' }
512513 )
513- return self ._make_request (
514- 'get' ,
515- f'repos/{ repo } /commits' ,
516- params = {
517- 'since' : since .strftime ('%Y-%m-%dT%H:%M:%SZ' ), 'sha' : branch
518- }
519- )
514+ opts = {'since' : since .strftime ('%Y-%m-%dT%H:%M:%SZ' ), 'sha' : branch }
515+ if path :
516+ opts ['path' ] = path
517+ return self ._make_request ('get' , f'repos/{ repo } /commits' , params = opts )
520518
521519 def get_branch_protection_details (self , repo , branch = 'master' ):
522520 """
0 commit comments