File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 153153 $ Commits = [];
154154
155155 if (!empty ($ Message ['commits ' ])) {
156+ $ PusherName = $ Msg ['alias ' ] ?? '' ;
157+ $ AllSameAuthor = array_reduce ($ Message ['commits ' ], function (bool $ carry , array $ c ) use ($ PusherName ): bool {
158+ return $ carry && (($ c ['author ' ]['name ' ] ?? '' ) === $ PusherName );
159+ }, true );
160+
156161 foreach ($ Message ['commits ' ] as $ Commit ) {
157162 $ CommitMsg = strtok ($ Commit ['message ' ], "\n" );
158163 $ FileCounts = [];
159164 if (!empty ($ Commit ['added ' ])) $ FileCounts [] = '+ ' . count ($ Commit ['added ' ]);
160165 if (!empty ($ Commit ['modified ' ])) $ FileCounts [] = '~ ' . count ($ Commit ['modified ' ]);
161166 if (!empty ($ Commit ['removed ' ])) $ FileCounts [] = '- ' . count ($ Commit ['removed ' ]);
162167 $ FileInfo = !empty ($ FileCounts ) ? ' _( ' . implode (' ' , $ FileCounts ) . ' files)_ ' : '' ;
163- $ Commits [] = " • [ " . substr ( $ Commit [ ' id ' ], 0 , 7 ) . " ]( {$ Commit ['url ' ]} ) _ { $ CommitMsg } _ "
164- . "by {$ Commit ['author ' ][ ' name ' ] }{$ FileInfo }" ;
168+ $ ByAuthor = $ AllSameAuthor ? '' : " by {$ Commit ['author ' ][ ' name ' ]}" ;
169+ $ Commits [] = " • [ " . substr ( $ Commit [ ' id ' ], 0 , 7 ) . "]( {$ Commit ['url ' ]} ) _ { $ CommitMsg } _ { $ ByAuthor }{$ FileInfo }" ;
165170 }
166171 }
167172
You can’t perform that action at this time.
0 commit comments