File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export abstract class ChangesContentProvider implements Partial<vscode.FileSyste
5959 return { dispose : ( ) => { } } ;
6060 }
6161
62- stat ( _uri : any ) : vscode . FileStat {
62+ async stat ( _uri : any ) : Promise < vscode . FileStat > {
6363 // const params = fromGitHubURI(uri);
6464
6565 return {
@@ -141,6 +141,28 @@ export class GitContentProvider extends ChangesContentProvider implements vscode
141141 super ( ) ;
142142 }
143143
144+ override async stat ( uri : vscode . Uri ) : Promise < vscode . FileStat > {
145+ let mtime = 0 ;
146+ const params = fromGitHubURI ( uri ) ;
147+ if ( params ?. branch ) {
148+ const branch = await this . folderRepositoryManager . repository . getBranch ( params ?. branch ) ;
149+ if ( branch . commit ) {
150+ const commit = await this . folderRepositoryManager . repository . getCommit ( branch . commit ) ;
151+ if ( commit ) {
152+ mtime = commit . commitDate ?. getTime ( ) ?? 0 ;
153+ }
154+ }
155+
156+ }
157+ return {
158+ type : vscode . FileType . File ,
159+ ctime : 0 ,
160+ mtime : mtime ,
161+ size : 0 ,
162+ permissions : vscode . FilePermission . Readonly
163+ } ;
164+ }
165+
144166 async readFile ( uri : vscode . Uri ) : Promise < Uint8Array > {
145167 const params = fromGitHubURI ( uri ) ;
146168 if ( ! params || params . isEmpty ) {
You can’t perform that action at this time.
0 commit comments