Description
list-changed-files.sh silently skips every other file when all changed files are modified (no added/deleted/renamed interleaving).
Root Cause
The extract_files function uses an inner read to peek at the next line for change-type detection, but it consumes from the same input stream as the outer while read loop. When consecutive diff --git lines have no intervening new file/deleted file/rename from lines, the inner read swallows the next file's header.
Fix
Replace the stream-based while read with mapfile into an array and use index-based lookahead. The PowerShell counterpart (list-changed-files.ps1) is unaffected — it uses regex block matching.
Acceptance Criteria
Description
list-changed-files.shsilently skips every other file when all changed files are modified (no added/deleted/renamed interleaving).Root Cause
The
extract_filesfunction uses an innerreadto peek at the next line for change-type detection, but it consumes from the same input stream as the outerwhile readloop. When consecutivediff --gitlines have no interveningnew file/deleted file/rename fromlines, the innerreadswallows the next file's header.Fix
Replace the stream-based
while readwithmapfileinto an array and use index-based lookahead. The PowerShell counterpart (list-changed-files.ps1) is unaffected — it uses regex block matching.Acceptance Criteria
list-changed-files.shreturns all files when every file is modified--type,--exclude-type) work with the updated parsing