From 99a76f74b258b196c414a6192a8615ffdffd9c90 Mon Sep 17 00:00:00 2001 From: Guy Vago Date: Tue, 14 Apr 2026 18:37:11 +0300 Subject: [PATCH] fix(azure): use last_merge_source_commit for PR head SHA The code was using `last_merge_commit` which points to a merge commit (or differs from the source branch head), causing incorrect diff computation. Switch to `last_merge_source_commit` to get the actual source branch tip, with a fallback to `last_merge_commit` when the attribute is unavailable. Co-Authored-By: Claude Opus 4.6 (1M context) --- pr_agent/git_providers/azuredevops_provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/git_providers/azuredevops_provider.py b/pr_agent/git_providers/azuredevops_provider.py index b9d2f3990c..c73a83540a 100644 --- a/pr_agent/git_providers/azuredevops_provider.py +++ b/pr_agent/git_providers/azuredevops_provider.py @@ -198,7 +198,7 @@ def get_diff_files(self) -> list[FilePatchInfo]: return self.diff_files base_sha = self.pr.last_merge_target_commit - head_sha = self.pr.last_merge_commit + head_sha = getattr(self.pr, 'last_merge_source_commit', None) or self.pr.last_merge_commit # Get PR iterations iterations = self.azure_devops_client.get_pull_request_iterations(