Skip to content

Commit 45bce24

Browse files
committed
Fixes similarity threshold ignored in diff file listing
`getDiffStatus` used a bare `-M` for rename detection, falling back to Git's default 50% threshold instead of the configured `gitlens.advanced.similarityThreshold`. The same value is correctly wired in `getDiffForFileCore`; this restores the `context.config.commits.similarityThreshold` fallback here too. Regression from the standalone-packages refactor.
1 parent 94eef6b commit 45bce24

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
4646
### Fixed
4747

4848
- Fixes opening the _Commit Graph_ in multi root workspace to the correct repo ([#5276](https://github.com/gitkraken/vscode-gitlens/issues/5276))
49+
- Fixes the `gitlens.advanced.similarityThreshold` setting being ignored when listing changed files for a diff — rename detection used Git's default threshold (50%) instead of the configured value
4950
- Fixes force push from the _Push_ command always using `--force-with-lease` (and `--force-if-includes`) and ignoring VS Code's `git.useForcePushWithLease` and `git.useForcePushIfIncludes` settings — the confirmation could offer a plain `--force` while GitLens still pushed with lease; it now honors the configured preference
5051
- Fixes _Stash Unstaged Changes_ also stashing staged changes when an untracked file is involved — including untracked files no longer drops the `--keep-index` flag, so staged changes are correctly kept intact ([#5281](https://github.com/gitkraken/vscode-gitlens/issues/5281))
5152
- Fixes push from the _Commit Graph_ silently pushing to a wrong remote branch when the local branch tracks a differently-named upstream (e.g., `feature/foo` tracking `origin/main`) — now correctly pushes to the configured upstream branch instead of creating a new remote branch ([#5304](https://github.com/gitkraken/vscode-gitlens/issues/5304))

packages/git-cli/src/providers/diff.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
218218
},
219219
): Promise<GitFile[] | undefined> {
220220
try {
221-
const similarityThreshold = options?.similarityThreshold;
221+
const similarityThreshold =
222+
options?.similarityThreshold ?? this.context.config?.commits.similarityThreshold;
222223
const configs =
223224
options?.renameLimit != null
224225
? [...gitConfigsDiff, '-c', `diff.renameLimit=${options.renameLimit}`]

0 commit comments

Comments
 (0)