Skip to content

Commit 9176c0d

Browse files
author
mhoecke1
committed
adding config value for old Bitbucket Server diff functionality
1 parent a99ebf8 commit 9176c0d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pr_agent/git_providers/bitbucket_server_provider.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ def get_diff_files(self) -> list[FilePatchInfo]:
156156
guaranteed_common_ancestor = source_commits_list[-1]['parents'][0]['id']
157157
destination_commits = list(self.bitbucket_client.get_commits(self.workspace_slug, self.repo_slug, guaranteed_common_ancestor, self.pr.toRef['latestCommit']))
158158

159-
base_sha = self.get_best_common_ancestor(source_commits_list, destination_commits, guaranteed_common_ancestor)
159+
base_sha = self.pr.toRef['latestCommit']
160160
head_sha = self.pr.fromRef['latestCommit']
161+
if "legacy_diff_calculation" not in get_settings().bitbucket_server or not get_settings().bitbucket_server.legacy_diff_calculation:
162+
base_sha = self.get_best_common_ancestor(source_commits_list, destination_commits, guaranteed_common_ancestor)
161163

162164
diff_files = []
163165
original_file_content_str = ""

pr_agent/settings/configuration.toml

+1
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ pr_commands = [
263263
"/review --pr_reviewer.num_code_suggestions=0",
264264
"/improve --pr_code_suggestions.commitable_code_suggestions=true --pr_code_suggestions.suggestions_score_threshold=7",
265265
]
266+
legacy_diff_calculation = true
266267

267268
[litellm]
268269
# use_client = false

0 commit comments

Comments
 (0)