From f29f77fc0d20746e7ee14ef2bbcfc3639007e0b6 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 29 Jul 2022 03:29:16 -0400 Subject: [PATCH] Gives up waiting for resolve if too slow --- src/commands/diffWith.ts | 4 ++-- src/git/gitProviderService.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/diffWith.ts b/src/commands/diffWith.ts index 632f410..2d86fcf 100644 --- a/src/commands/diffWith.ts +++ b/src/commands/diffWith.ts @@ -93,11 +93,11 @@ export class DiffWithCommand extends Command { [args.lhs.sha, args.rhs.sha] = await Promise.all([ await this.container.git.resolveReference(args.repoPath, args.lhs.sha, args.lhs.uri, { // If the ref looks like a sha, don't wait too long, since it should work - timeout: GitRevision.isSha(args.lhs.sha) ? 100 : undefined, + timeout: GitRevision.isShaLike(args.lhs.sha) ? 100 : undefined, }), await this.container.git.resolveReference(args.repoPath, args.rhs.sha, args.rhs.uri, { // If the ref looks like a sha, don't wait too long, since it should work - timeout: GitRevision.isSha(args.rhs.sha) ? 100 : undefined, + timeout: GitRevision.isShaLike(args.rhs.sha) ? 100 : undefined, }), ]); diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index addcc8d..f951131 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -2166,6 +2166,7 @@ export class GitProviderService implements Disposable { options?: { timeout?: number }, ): Promise; async resolveReference(repoPath: string, ref: string, uri?: Uri, options?: { timeout?: number }): Promise; + @gate() @log() async resolveReference( repoPath: string | Uri,