bug: pr_files_diff returns same diff for all files #25
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
pr_files_diffreturns the same diff content for every file in the response. Each file entry shows identical diff text instead of its own diff.Observed behaviour
When calling
pr_files_diffon PR #21, all 13 files in the response contained the same diff block (the content ofrepo_update_test.go) regardless of which file path was listed.Expected behaviour
Each file entry should contain the diff for that specific file.
Likely cause
A loop or variable reuse bug in
internal/tools/pr_files_diff.go— probably the diff string is assigned once and reused across iterations instead of being read per file.Steps to reproduce
Call
pr_files_diffon any PR with multiple files and compare the diff content across entries.Impact
Makes the tool unreliable for code review workflows — cannot use it to inspect individual file changes in a PR.
Fix
Review the loop in
internal/tools/pr_files_diff.gothat assembles the per-file diff output. Ensure each iteration reads and assigns the correct diff for its own file.