mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Adds timestamp to GitHub stat requests
This commit is contained in:
@@ -353,7 +353,7 @@ export class GitHubApi implements Disposable {
|
||||
}
|
||||
|
||||
private readonly pendingContextRequests = new Map<string, Promise<GitHubApiContext>>();
|
||||
private async getContext(uri: Uri): Promise<GitHubApiContext> {
|
||||
async getContext(uri: Uri): Promise<GitHubApiContext> {
|
||||
const rootUri = getRootUri(uri);
|
||||
|
||||
let pending = this.pendingContextRequests.get(rootUri.toString());
|
||||
|
||||
@@ -89,8 +89,10 @@ export class GitHubFS implements FileSystemProvider, FileSearchProvider, TextSea
|
||||
}
|
||||
|
||||
async stat(uri: Uri): Promise<FileStat> {
|
||||
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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user