summaryrefslogtreecommitdiffstats
path: root/g2h/git.py
blob: e6984c465191f473731618a8103ecb8b1d604b54 (plain)
1
2
3
4
5
6
7
8
9
10
11
import git

class Git:
    def __init__(self, repo_path):
        try:
            self.repo = git.Repo(repo_path)
        except git.InvalidGitRepositoryError:
            raise ValueError(f"Invalid git repository at {repo_path}")

    def get_all_commits(self):
        return list(self.repo.iter_commits())