bug: pr_files_diff returns same diff for all files #25

Closed
opened 2026-05-15 15:30:55 +00:00 by mathias · 0 comments
Owner

Bug

pr_files_diff returns 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_diff on PR #21, all 13 files in the response contained the same diff block (the content of repo_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_diff on 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.go that assembles the per-file diff output. Ensure each iteration reads and assigns the correct diff for its own file.

## Bug `pr_files_diff` returns 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_diff` on PR #21, all 13 files in the response contained the same diff block (the content of `repo_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_diff` on 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.go` that assembles the per-file diff output. Ensure each iteration reads and assigns the correct diff for its own file.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/gitea-mcp#25