fix(utils): handle empty commit messages in CommitInfo.format

Empty git commit messages made splitlines()[0] raise IndexError in format() and /dream-restore list rendering.
This commit is contained in:
santhreal
2026-07-18 17:22:16 +08:00
committed by Xubin Ren
parent 6de5a0c5ca
commit 85097aa143
3 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -650,7 +650,7 @@ def _format_dream_restore_list(commits: list) -> str:
"",
]
for c in commits:
lines.append(f"- `{c.sha}` {c.timestamp} - {c.message.splitlines()[0]}")
lines.append(f"- `{c.sha}` {c.timestamp} - {c.subject()}")
lines.extend([
"",
"Preview a version with `/dream-log <sha>` before restoring it.",