@@ -264,6 +264,7 @@ static void squash_message(void)
264264 struct strbuf out = STRBUF_INIT ;
265265 struct commit_list * j ;
266266 int fd ;
267+ struct pretty_print_context ctx = {0 };
267268
268269 printf ("Squash commit -- not updating HEAD\n" );
269270 fd = open (git_path ("SQUASH_MSG" ), O_WRONLY | O_CREAT , 0666 );
@@ -285,13 +286,15 @@ static void squash_message(void)
285286 if (prepare_revision_walk (& rev ))
286287 die ("revision walk setup failed" );
287288
289+ ctx .abbrev = rev .abbrev ;
290+ ctx .date_mode = rev .date_mode ;
291+
288292 strbuf_addstr (& out , "Squashed commit of the following:\n" );
289293 while ((commit = get_revision (& rev )) != NULL ) {
290294 strbuf_addch (& out , '\n' );
291295 strbuf_addf (& out , "commit %s\n" ,
292296 sha1_to_hex (commit -> object .sha1 ));
293- pretty_print_commit (rev .commit_format , commit , & out , rev .abbrev ,
294- NULL , NULL , rev .date_mode , 0 );
297+ pretty_print_commit (rev .commit_format , commit , & out , & ctx );
295298 }
296299 if (write (fd , out .buf , out .len ) < 0 )
297300 die_errno ("Writing SQUASH_MSG" );
0 commit comments