Git - pass the similarityThreshold to git diff-tree (#238367)

This commit is contained in:
Ladislau Szomoru
2025-01-21 15:38:47 +01:00
committed by GitHub
parent 3a459b0c14
commit a0ecf511fd
2 changed files with 12 additions and 3 deletions

View File

@@ -1592,8 +1592,14 @@ export class Repository {
return parseGitChanges(this.repositoryRoot, gitResult.stdout);
}
async diffTrees(treeish1: string, treeish2?: string): Promise<Change[]> {
const args = ['diff-tree', '-r', '--name-status', '-z', '--diff-filter=ADMR', treeish1];
async diffTrees(treeish1: string, treeish2?: string, options?: { similarityThreshold?: number }): Promise<Change[]> {
const args = ['diff-tree', '-r', '--name-status', '-z', '--diff-filter=ADMR'];
if (options?.similarityThreshold) {
args.push(`--find-renames=${options.similarityThreshold}%`);
}
args.push(treeish1);
if (treeish2) {
args.push(treeish2);