File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
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 ) {
@@ -239,9 +239,6 @@ export async function main() {
239239
240240 for ( const commit of commits ) {
241241 console . log ( `\n${ commit . hash } ${ commit . subject } ` ) ;
242- if ( commit . body ) {
243- console . log ( `${ commit . body } ` ) ;
244- }
245242
246243 const includeCommit = await confirm ( {
247244 message : '🔄 Include this commit in PR description?'
You can’t perform that action at this time.
0 commit comments