mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
Fix timeline git requests are not cancelled when switching editors too fast (#244335)
* Cancel git log commands from timeline * Don't delete timeline requests when cancelled as they already got deleted --------- Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com>
This commit is contained in:
@@ -1342,7 +1342,7 @@ export class Repository {
|
||||
return parseGitCommits(result.stdout);
|
||||
}
|
||||
|
||||
async logFile(uri: Uri, options?: LogFileOptions): Promise<Commit[]> {
|
||||
async logFile(uri: Uri, options?: LogFileOptions, cancellationToken?: CancellationToken): Promise<Commit[]> {
|
||||
const args = ['log', `--format=${COMMIT_FORMAT}`, '-z'];
|
||||
|
||||
if (options?.maxEntries && !options?.reverse) {
|
||||
@@ -1373,7 +1373,7 @@ export class Repository {
|
||||
args.push('--', uri.fsPath);
|
||||
|
||||
try {
|
||||
const result = await this.exec(args);
|
||||
const result = await this.exec(args, { cancellationToken });
|
||||
if (result.exitCode) {
|
||||
// No file history, e.g. a new file or untracked
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user