We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13c3cf8 commit bfcf4aaCopy full SHA for bfcf4aa
src/git_autograder/helpers/commit_helper.py
@@ -13,3 +13,12 @@ def __init__(self, repo: Repo) -> None:
13
def commit(self, rev: Optional[Union[Commit_ish, str]]) -> GitAutograderCommit:
14
c = self.repo.commit(rev)
15
return GitAutograderCommit(c)
16
+
17
+ def commit_or_none(
18
+ self, rev: Optional[Union[Commit_ish, str]]
19
+ ) -> Optional[GitAutograderCommit]:
20
+ try:
21
+ c = self.repo.commit(rev)
22
+ return GitAutograderCommit(c)
23
+ except Exception:
24
+ return None
0 commit comments