diff --git a/src/config.ts b/src/config.ts index 349a21d..424fc9c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -87,7 +87,7 @@ export interface Config { }; toggleMode: AnnotationsToggleMode; }; - remotes: RemotesConfig[]; + remotes: RemotesConfig[] | null; showWhatsNewAfterUpgrades: boolean; sortBranchesBy: BranchSorting; sortTagsBy: TagSorting; @@ -255,7 +255,7 @@ export interface AdvancedConfig { closeOnFocusOut: boolean; }; repositorySearchDepth: number; - similarityThreshold: number; + similarityThreshold: number | null; telemetry: { enabled: boolean; }; diff --git a/src/git/git.ts b/src/git/git.ts index 1bf6206..4c8c1ab 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -553,7 +553,7 @@ export namespace Git { fileName: string, ref1?: string, ref2?: string, - options: { encoding?: string; filter?: string; similarityThreshold?: number } = {} + options: { encoding?: string; filter?: string; similarityThreshold?: number | null } = {} ): Promise { const params = [ 'diff', @@ -605,7 +605,7 @@ export namespace Git { repoPath: string, ref1?: string, ref2?: string, - { filter, similarityThreshold }: { filter?: string; similarityThreshold?: number } = {} + { filter, similarityThreshold }: { filter?: string; similarityThreshold?: number | null } = {} ) { const params = [ 'diff', @@ -697,7 +697,13 @@ export namespace Git { merges, reverse, similarityThreshold - }: { authors?: string[]; limit?: number; merges?: boolean; reverse?: boolean; similarityThreshold?: number } + }: { + authors?: string[]; + limit?: number; + merges?: boolean; + reverse?: boolean; + similarityThreshold?: number | null; + } ) { const params = [ 'log', @@ -806,7 +812,7 @@ export namespace Git { export async function log__file_recent( repoPath: string, fileName: string, - { ref, similarityThreshold }: { ref?: string; similarityThreshold?: number } = {} + { ref, similarityThreshold }: { ref?: string; similarityThreshold?: number | null } = {} ) { const params = [ 'log', @@ -1068,7 +1074,7 @@ export namespace Git { fileName: string, ref: string, originalFileName?: string, - { similarityThreshold }: { similarityThreshold?: number } = {} + { similarityThreshold }: { similarityThreshold?: number | null } = {} ) { const params = [ 'show', @@ -1110,7 +1116,7 @@ export namespace Git { { format = GitStashParser.defaultFormat, similarityThreshold - }: { format?: string; similarityThreshold?: number } = {} + }: { format?: string; similarityThreshold?: number | null } = {} ) { return git( { cwd: repoPath }, @@ -1156,7 +1162,7 @@ export namespace Git { export function status( repoPath: string, porcelainVersion: number = 1, - { similarityThreshold }: { similarityThreshold?: number } = {} + { similarityThreshold }: { similarityThreshold?: number | null } = {} ): Promise { const params = [ 'status', @@ -1165,7 +1171,7 @@ export namespace Git { '-u' ]; if (Git.validateVersion(2, 18)) { - params.push(`--find-renames=${similarityThreshold == null ? '' : `${similarityThreshold}%`}`); + params.push(`--find-renames${similarityThreshold == null ? '' : `=${similarityThreshold}%`}`); } return git( @@ -1179,13 +1185,13 @@ export namespace Git { repoPath: string, fileName: string, porcelainVersion: number = 1, - { similarityThreshold }: { similarityThreshold?: number } = {} + { similarityThreshold }: { similarityThreshold?: number | null } = {} ): Promise { const [file, root] = Git.splitPath(fileName, repoPath); const params = ['status', porcelainVersion >= 2 ? `--porcelain=v${porcelainVersion}` : '--porcelain']; if (Git.validateVersion(2, 18)) { - params.push(`--find-renames=${similarityThreshold == null ? '' : `${similarityThreshold}%`}`); + params.push(`--find-renames${similarityThreshold == null ? '' : `=${similarityThreshold}%`}`); } return git(