Refactor merge conflict check to use branch names instead of commit hashes

- Updated _check_git_conflicts function to utilize branch names for the merge-tree command, improving clarity and correctness in conflict resolution.
This commit is contained in:
AndyMik90
2025-12-17 10:54:32 +01:00
parent dfb5cf9c50
commit e6d6cea9e4
+3 -3
View File
@@ -519,15 +519,15 @@ def _check_git_conflicts(project_dir: Path, spec_name: str) -> dict:
spec_commit = spec_commit_result.stdout.strip() spec_commit = spec_commit_result.stdout.strip()
# Use git merge-tree to check for conflicts WITHOUT touching working directory # Use git merge-tree to check for conflicts WITHOUT touching working directory
# Note: --write-tree mode only accepts 2 branches (it auto-finds the merge base)
merge_tree_result = subprocess.run( merge_tree_result = subprocess.run(
[ [
"git", "git",
"merge-tree", "merge-tree",
"--write-tree", "--write-tree",
"--no-messages", "--no-messages",
merge_base, result["base_branch"], # Use branch names, not commit hashes
main_commit, spec_branch,
spec_commit,
], ],
cwd=project_dir, cwd=project_dir,
capture_output=True, capture_output=True,