git-sync-web 自动提交 2026-09-09 15:27:47

This commit is contained in:
tamakyi
2026-09-09 15:27:48 +08:00
parent eae64f5c47
commit 4232da5ced
+1
View File
@@ -632,6 +632,7 @@ function parseUnifiedDiff(text) {
const files = [];
let cur = null;
let oldNo = 0, newNo = 0;
let inHunk = false; // 词级模式(--word-diff=plain)下 git 的上下文行不带前导空格,需据此兜底
const push = (header) => { cur = { header, rows: [] }; files.push(cur); return cur; };
for (const line of lines) {
if (line.startsWith('diff --git') || line.startsWith('Index: ')) { push(line); continue; }