fix(dream): ignore line-ending-only memory diffs

This commit is contained in:
bingqilinweimaotai
2026-07-14 00:30:50 +08:00
committed by chengyongru
parent 6b5820ea89
commit ed47cf1562
2 changed files with 38 additions and 3 deletions
+7 -3
View File
@@ -377,12 +377,16 @@ class GitStore:
changed += 1
summary_lines.append(f"{path}: binary or non-UTF-8 file changed")
continue
if head_text == wt_text:
# Git blobs preserve line endings while read_text() normalizes
# them. Compare the same logical lines used by the diff.
head_lines = head_text.splitlines()
wt_lines = wt_text.splitlines()
if head_lines == wt_lines:
continue
changed += 1
hunks = list(difflib.unified_diff(
head_text.splitlines(),
wt_text.splitlines(),
head_lines,
wt_lines,
fromfile=path,
tofile=path,
lineterm="",