@@ -145,29 +145,34 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
145145 return [ ] ;
146146 }
147147
148- // Get the commits
149- const commits = await this . repository . log ( { range : `${ refsMergeBase } ^..` , refNames } ) ;
150-
151- await ensureEmojis ( ) ;
152-
153148 const historyItems : SourceControlHistoryItem [ ] = [ ] ;
154- historyItems . push ( ...commits . map ( commit => {
155- const newLineIndex = commit . message . indexOf ( '\n' ) ;
156- const subject = newLineIndex !== - 1 ? commit . message . substring ( 0 , newLineIndex ) : commit . message ;
157-
158- const labels = this . resolveHistoryItemLabels ( commit , refNames ) ;
159149
160- return {
161- id : commit . hash ,
162- parentIds : commit . parents ,
163- message : emojify ( subject ) ,
164- author : commit . authorName ,
165- icon : new ThemeIcon ( 'git-commit' ) ,
166- timestamp : commit . authorDate ?. getTime ( ) ,
167- statistics : commit . shortStat ?? { files : 0 , insertions : 0 , deletions : 0 } ,
168- labels : labels . length !== 0 ? labels : undefined
169- } ;
170- } ) ) ;
150+ try {
151+ // Get the commits
152+ const commits = await this . repository . log ( { range : `${ refsMergeBase } ^..` , refNames } ) ;
153+
154+ await ensureEmojis ( ) ;
155+
156+ historyItems . push ( ...commits . map ( commit => {
157+ const newLineIndex = commit . message . indexOf ( '\n' ) ;
158+ const subject = newLineIndex !== - 1 ? commit . message . substring ( 0 , newLineIndex ) : commit . message ;
159+
160+ const labels = this . resolveHistoryItemLabels ( commit , refNames ) ;
161+
162+ return {
163+ id : commit . hash ,
164+ parentIds : commit . parents ,
165+ message : emojify ( subject ) ,
166+ author : commit . authorName ,
167+ icon : new ThemeIcon ( 'git-commit' ) ,
168+ timestamp : commit . authorDate ?. getTime ( ) ,
169+ statistics : commit . shortStat ?? { files : 0 , insertions : 0 , deletions : 0 } ,
170+ labels : labels . length !== 0 ? labels : undefined
171+ } ;
172+ } ) ) ;
173+ } catch ( err ) {
174+ this . logger . error ( `[GitHistoryProvider][provideHistoryItems2] Failed to get history items '${ refsMergeBase } ^..': ${ err } ` ) ;
175+ }
171176
172177 return historyItems ;
173178 }
0 commit comments