File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ function CommitStatsChips({ stats }: { stats: CommitMetadata['stats'] }) {
7373 ) ;
7474}
7575
76+ function isSamePerson ( a : CommitMetadata [ 'author' ] , b : CommitMetadata [ 'committer' ] ) : boolean {
77+ return a . name === b . name && a . email === b . email && a . date === b . date ;
78+ }
79+
7680function CommitPersonRow ( { label, person } : { label : string ; person : CommitMetadata [ 'author' ] } ) {
7781 return (
7882 < div className = "commit-details-person" >
@@ -194,8 +198,14 @@ export function CommitDetailsPanel({
194198 </ section >
195199 ) : null }
196200 < section aria-label = "Commit metadata" className = "commit-details-grid" >
197- < CommitPersonRow label = "Author" person = { metadata . author } />
198- < CommitPersonRow label = "Committer" person = { metadata . committer } />
201+ { isSamePerson ( metadata . author , metadata . committer ) ? (
202+ < CommitPersonRow label = "Author & Committer" person = { metadata . author } />
203+ ) : (
204+ < >
205+ < CommitPersonRow label = "Author" person = { metadata . author } />
206+ < CommitPersonRow label = "Committer" person = { metadata . committer } />
207+ </ >
208+ ) }
199209 < div className = "commit-details-cell" >
200210 < h3 > Refs</ h3 >
201211 { metadata . refs . length > 0 ? (
You can’t perform that action at this time.
0 commit comments