Bläddra i källkod

Fixes gates

main
Eric Amodio 3 år sedan
förälder
incheckning
e556d3302d
2 ändrade filer med 13 tillägg och 5 borttagningar
  1. +11
    -3
      src/git/gitService.ts
  2. +2
    -2
      src/git/models/commit.ts

+ 11
- 3
src/git/gitService.ts Visa fil

@ -3045,7 +3045,12 @@ export class GitService implements Disposable {
provider: RichRemoteProvider, provider: RichRemoteProvider,
options?: { avatarSize?: number; include?: PullRequestState[]; limit?: number; timeout?: number }, options?: { avatarSize?: number; include?: PullRequestState[]; limit?: number; timeout?: number },
): Promise<PullRequest | undefined>; ): Promise<PullRequest | undefined>;
@gate()
@gate<GitService['getPullRequestForBranch']>((ref, remoteOrProvider, options) => {
const provider = GitRemote.is(remoteOrProvider) ? remoteOrProvider.provider : remoteOrProvider;
return `${ref}${provider != null ? `|${provider.id}:${provider.domain}/${provider.path}` : ''}${
options != null ? `|${options.limit ?? -1}:${options.include?.join(',')}` : ''
}`;
})
@debug<GitService['getPullRequestForBranch']>({ @debug<GitService['getPullRequestForBranch']>({
args: { args: {
1: (remoteOrProvider: GitRemote | RichRemoteProvider) => remoteOrProvider.name, 1: (remoteOrProvider: GitRemote | RichRemoteProvider) => remoteOrProvider.name,
@ -3097,8 +3102,11 @@ export class GitService implements Disposable {
provider: RichRemoteProvider, provider: RichRemoteProvider,
options?: { timeout?: number }, options?: { timeout?: number },
): Promise<PullRequest | undefined>; ): Promise<PullRequest | undefined>;
@gate()
@debug({
@gate<GitService['getPullRequestForCommit']>((ref, remoteOrProvider) => {
const provider = GitRemote.is(remoteOrProvider) ? remoteOrProvider.provider : remoteOrProvider;
return `${ref}${provider != null ? `|${provider.id}:${provider.domain}/${provider.path}` : ''}`;
})
@debug<GitService['getPullRequestForCommit']>({
args: { args: {
1: (remoteOrProvider: GitRemote | RichRemoteProvider) => remoteOrProvider.name, 1: (remoteOrProvider: GitRemote | RichRemoteProvider) => remoteOrProvider.name,
}, },

+ 2
- 2
src/git/models/commit.ts Visa fil

@ -147,11 +147,11 @@ export abstract class GitCommit implements GitRevisionReference {
} }
@memoize() @memoize()
async getAssociatedPullRequest(): Promise<PullRequest | undefined> {
async getAssociatedPullRequest(options?: { timeout?: number }): Promise<PullRequest | undefined> {
const remote = await Container.git.getRichRemoteProvider(this.repoPath); const remote = await Container.git.getRichRemoteProvider(this.repoPath);
if (remote?.provider == null) return undefined; if (remote?.provider == null) return undefined;
return Container.git.getPullRequestForCommit(this.ref, remote);
return Container.git.getPullRequestForCommit(this.ref, remote, options);
} }
@memoize<GitCommit['getPreviousLineDiffUris']>( @memoize<GitCommit['getPreviousLineDiffUris']>(

Laddar…
Avbryt
Spara