Skip to content

Commit c8f734b

Browse files
Update github_rest_api/github.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent c4f19f2 commit c8f734b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

github_rest_api/github.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ def _head_commit_date(self, sha: str) -> str:
777777
url=f"{self._url_repo}/commits",
778778
params={"sha": sha, "per_page": 1},
779779
).json()
780+
if not isinstance(commits, list) or not commits:
781+
raise ValueError(f"No commits found for SHA {sha}")
780782
return commits[0]["commit"]["committer"]["date"]
781783

782784
def get_branches(self, n: int = 0) -> list[dict[str, Any]]:

0 commit comments

Comments
 (0)