diff --git a/extensions/github-browser/src/github/api.ts b/extensions/github-browser/src/github/api.ts index 211c4413d1f..3e26d169870 100644 --- a/extensions/github-browser/src/github/api.ts +++ b/extensions/github-browser/src/github/api.ts @@ -353,7 +353,7 @@ export class GitHubApi implements Disposable { } private readonly pendingContextRequests = new Map>(); - private async getContext(uri: Uri): Promise { + async getContext(uri: Uri): Promise { const rootUri = getRootUri(uri); let pending = this.pendingContextRequests.get(rootUri.toString()); diff --git a/extensions/github-browser/src/github/fs.ts b/extensions/github-browser/src/github/fs.ts index a70cb7758db..3f9ae2e9c74 100644 --- a/extensions/github-browser/src/github/fs.ts +++ b/extensions/github-browser/src/github/fs.ts @@ -89,8 +89,10 @@ export class GitHubFS implements FileSystemProvider, FileSearchProvider, TextSea } async stat(uri: Uri): Promise { + const context = await this.github.getContext(uri); + if (uri.path === '' || uri.path.lastIndexOf('/') === 0) { - return { type: FileType.Directory, size: 0, ctime: 0, mtime: 0 }; + return { type: FileType.Directory, size: 0, ctime: 0, mtime: context?.timestamp }; } const data = await this.fsQuery<{ @@ -109,7 +111,7 @@ export class GitHubFS implements FileSystemProvider, FileSearchProvider, TextSea type: typenameToFileType(data?.__typename), size: data?.byteSize ?? 0, ctime: 0, - mtime: 0, + mtime: context?.timestamp, }; }