Browse Source

Changes missing repo id to `-` in deeplinks

main
Eric Amodio 1 year ago
parent
commit
33bc5845d9
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      src/git/gitProviderService.ts
  2. +1
    -1
      src/uris/deepLinks/deepLinkService.ts

+ 3
- 3
src/git/gitProviderService.ts View File

@ -97,7 +97,7 @@ const weightedDefaultBranches = new Map([
['development', 1],
]);
const defaultRepositoryId = '0';
const missingRepositoryId = '-';
export type GitProvidersChangeEvent = {
readonly added: readonly GitProvider[];
@ -2511,12 +2511,12 @@ export class GitProviderService implements Disposable {
}
@log()
async getUniqueRepositoryId(repoPath: string | Uri): Promise<string | undefined> {
async getUniqueRepositoryId(repoPath: string | Uri): Promise<string> {
const { provider, path } = this.getProvider(repoPath);
const id = await provider.getUniqueRepositoryId(path);
if (id != null) return id;
return defaultRepositoryId;
return missingRepositoryId;
}
@log({ args: { 1: false } })

+ 1
- 1
src/uris/deepLinks/deepLinkService.ts View File

@ -610,7 +610,7 @@ export class DeepLinkService implements Disposable {
targetId?: string,
): Promise<URL> {
const repoPath = typeof refOrRepoPath !== 'string' ? refOrRepoPath.repoPath : refOrRepoPath;
const repoId = (await this.container.git.getUniqueRepositoryId(repoPath)) ?? '0';
const repoId = await this.container.git.getUniqueRepositoryId(repoPath);
if (typeof refOrRepoPath !== 'string') {
switch (refOrRepoPath.refType) {

Loading…
Cancel
Save