From ea6e1811c156f61761e92ef6f312e372833acac0 Mon Sep 17 00:00:00 2001 From: Patryk Kowalski Date: Wed, 26 Jul 2023 14:15:50 +0200 Subject: [PATCH 1/2] Fixed PR title - should be feature branch name, not target branch name --- pr_agent/git_providers/local_git_provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/git_providers/local_git_provider.py b/pr_agent/git_providers/local_git_provider.py index 4a7775ac..9c826777 100644 --- a/pr_agent/git_providers/local_git_provider.py +++ b/pr_agent/git_providers/local_git_provider.py @@ -167,7 +167,7 @@ class LocalGitProvider(GitProvider): """ Substitutes the branch-name as the PR-mimic title. """ - return self.target_branch_name + return self.head_branch_name def get_issue_comments(self): raise NotImplementedError('Getting issue comments is not implemented for the local git provider') From 3b19827ae212c8031574a41f05ca5c6c86573acd Mon Sep 17 00:00:00 2001 From: Patryk Kowalski Date: Wed, 26 Jul 2023 15:29:09 +0200 Subject: [PATCH 2/2] Add validation for repository path --- pr_agent/git_providers/local_git_provider.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pr_agent/git_providers/local_git_provider.py b/pr_agent/git_providers/local_git_provider.py index 9c826777..304417ea 100644 --- a/pr_agent/git_providers/local_git_provider.py +++ b/pr_agent/git_providers/local_git_provider.py @@ -30,6 +30,8 @@ class LocalGitProvider(GitProvider): def __init__(self, target_branch_name, incremental=False): 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.head_branch_name = self.repo.head.ref.name self.target_branch_name = target_branch_name