Merge pull request #142 from patryk-kowalski-ds/pk/local-git-provider-impvs

Improvements to Local Git Provider
This commit is contained in:
mrT23
2023-07-26 19:18:35 +03:00
committed by GitHub

View File

@ -30,6 +30,8 @@ class LocalGitProvider(GitProvider):
def __init__(self, target_branch_name, incremental=False): def __init__(self, target_branch_name, incremental=False):
self.repo_path = _find_repository_root() self.repo_path = _find_repository_root()
if self.repo_path is None:
raise ValueError('Could not find repository root')
self.repo = Repo(self.repo_path) self.repo = Repo(self.repo_path)
self.head_branch_name = self.repo.head.ref.name self.head_branch_name = self.repo.head.ref.name
self.target_branch_name = target_branch_name self.target_branch_name = target_branch_name
@ -167,7 +169,7 @@ class LocalGitProvider(GitProvider):
""" """
Substitutes the branch-name as the PR-mimic title. Substitutes the branch-name as the PR-mimic title.
""" """
return self.target_branch_name return self.head_branch_name
def get_issue_comments(self): def get_issue_comments(self):
raise NotImplementedError('Getting issue comments is not implemented for the local git provider') raise NotImplementedError('Getting issue comments is not implemented for the local git provider')