Skip to content

Commit d9bb53c

Browse files
committed
remove garbage
1 parent a49eab6 commit d9bb53c

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,12 @@
12791279
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the _Compare_ view",
12801280
"scope": "window"
12811281
},
1282+
"gitlens.views.compare.findRenames": {
1283+
"type": "number",
1284+
"default": 50,
1285+
"markdownDescription": "Specifies the threshold for the rename similarity index.",
1286+
"scope": "window"
1287+
},
12821288
"gitlens.views.compare.enabled": {
12831289
"type": "boolean",
12841290
"default": true,

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ export interface CompareViewConfig {
237237
avatars: boolean;
238238
enabled: boolean;
239239
files: ViewsFilesConfig;
240+
findRenames: number;
240241
location: 'explorer' | 'gitlens' | 'scm';
241242
}
242243

src/git/git.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,14 @@ export class Git {
550550
}
551551
}
552552

553-
static diff_nameStatus(repoPath: string, ref1?: string, ref2?: string, options: { filter?: string } = {}) {
554-
const params = ['diff', '--name-status', '-M', '--no-ext-diff'];
553+
static diff_nameStatus(
554+
repoPath: string,
555+
ref1?: string,
556+
ref2?: string,
557+
options: { filter?: string; findRenames?: number } = {}
558+
) {
559+
const renameParameter = options.findRenames == null ? '-M' : `-M${options.findRenames}%`;
560+
const params = ['diff', '--name-status', renameParameter, '--no-ext-diff'];
555561
if (options && options.filter) {
556562
params.push(`--diff-filter=${options.filter}`);
557563
}
@@ -651,14 +657,11 @@ export class Git {
651657
) {
652658
const [file, root] = Git.splitPath(fileName, repoPath);
653659

654-
const params = [...defaultLogParams, '-m'];
660+
const params = [...defaultLogParams];
655661
if (options.maxCount && !options.reverse) {
656662
params.push(`-n${options.maxCount}`);
657663
}
658-
659-
if (options.renames) {
660-
params.push('--follow');
661-
}
664+
params.push(options.renames ? '--follow' : '-m');
662665

663666
if (options.ref && !Git.isStagedUncommitted(options.ref)) {
664667
if (options.reverse) {

src/git/gitService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ export class GitService implements Disposable {
12821282
repoPath: string,
12831283
ref1?: string,
12841284
ref2?: string,
1285-
options: { filter?: string } = {}
1285+
options: { filter?: string; findRenames?: number } = {}
12861286
): Promise<GitFile[] | undefined> {
12871287
try {
12881288
const data = await Git.diff_nameStatus(repoPath, ref1, ref2, options);

0 commit comments

Comments
 (0)