@@ -15,7 +15,9 @@ import { getChangedFileDiffCommand, getCommitChangedFiles } from '@/changes/file
1515import { GitHub1sSourceControlDecorationProvider } from '@/providers/decorations/source-control' ;
1616
1717export const getCommitTreeItemDescription = ( commit : adapterTypes . Commit ) : string => {
18- return [ commit . sha . slice ( 0 , 7 ) , commit . author , relativeTimeTo ( commit . createTime ) ] . join ( ', ' ) ;
18+ const shortCommitSha = commit . sha . slice ( 0 , 7 ) ;
19+ const relativeTimeStr = commit . createTime ? relativeTimeTo ( commit . createTime ) : null ;
20+ return [ shortCommitSha , commit . author , relativeTimeStr ] . filter ( Boolean ) . join ( ', ' ) ;
1921} ;
2022
2123export interface CommitTreeItem extends vscode . TreeItem {
@@ -91,9 +93,9 @@ export class CommitTreeDataProvider implements vscode.TreeDataProvider<vscode.Tr
9193 const repository = Repository . getInstance ( currentAdapter . scheme , repo ) ;
9294 const repositoryCommits = await repository . getCommitList ( ref , filePath , this . _forceUpdate ) ;
9395 const commitTreeItems = repositoryCommits . map ( ( commit ) => {
94- const label = ` ${ commit . message } ` ;
96+ const label = commit . message . split ( / [ \r \n ] / ) [ 0 ] ;
9597 const description = getCommitTreeItemDescription ( commit ) ;
96- const tooltip = `${ label } (${ description } )` ;
98+ const tooltip = `${ commit . message } \n (${ description } )` ;
9799 const iconPath = vscode . Uri . parse ( commit . avatarUrl || '' ) ;
98100 const contextValue = 'github1s:viewItems:commitListItem' ;
99101
0 commit comments