Skip to content

Commit

Permalink
adding config value for old Bitbucket Server diff functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mhoecke1 committed Aug 26, 2024
1 parent a99ebf8 commit 0442cdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pr_agent/git_providers/bitbucket_server_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ def get_diff_files(self) -> list[FilePatchInfo]:
guaranteed_common_ancestor = source_commits_list[-1]['parents'][0]['id']
destination_commits = list(self.bitbucket_client.get_commits(self.workspace_slug, self.repo_slug, guaranteed_common_ancestor, self.pr.toRef['latestCommit']))

base_sha = self.get_best_common_ancestor(source_commits_list, destination_commits, guaranteed_common_ancestor)
base_sha = self.pr.toRef['latestCommit']
head_sha = self.pr.fromRef['latestCommit']
if not get_settings().bitbucket_server.get("legacy_diff_calculation", False):
base_sha = self.get_best_common_ancestor(source_commits_list, destination_commits, guaranteed_common_ancestor)

diff_files = []
original_file_content_str = ""
Expand Down
1 change: 1 addition & 0 deletions pr_agent/settings/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ pr_commands = [
"/review --pr_reviewer.num_code_suggestions=0",
"/improve --pr_code_suggestions.commitable_code_suggestions=true --pr_code_suggestions.suggestions_score_threshold=7",
]
legacy_diff_calculation = false

[litellm]
# use_client = false
Expand Down

0 comments on commit 0442cdc

Please sign in to comment.