File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,15 @@ const renderFileAsync = promisify(twig.renderFile);
1818// Get the three most recent commits
1919export function getRecentCommits ( count = 3 ) {
2020 try {
21- const format = '--pretty=format:%h\\|\\|\\|%s\\|\\|\\|%b' ;
21+ // Use %x00 (null byte) as commit separator to handle multi-line messages
22+ const format = '--pretty=format:%h\\|\\|\\|%s%x00' ;
2223 const output = execSync ( `git log -${ count } ${ format } ` ) . toString ( ) . trim ( ) ;
2324
24- return output . split ( '\n' ) . map ( line => {
25- const [ hash , subject , body ] = line . split ( '|||' ) ;
25+ return output . split ( '\x00' ) . filter ( Boolean ) . map ( line => {
26+ const [ hash , subject ] = line . split ( '|||' ) ;
2627 return {
2728 hash,
28- subject,
29- body : body ? body . trim ( ) : ''
29+ subject
3030 } ;
3131 } ) ;
3232 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments