Browse Source

Attempts to address #1213, #1219

main
Eric Amodio 4 years ago
parent
commit
b544895789
2 changed files with 10 additions and 5 deletions
  1. +9
    -5
      src/git/git.ts
  2. +1
    -0
      src/git/gitService.ts

+ 9
- 5
src/git/git.ts View File

@ -834,16 +834,20 @@ export namespace Git {
params.push('--all');
}
params.push(renames && startLine == null && all !== true ? '--follow' : '-m');
if (filters != null && filters.length !== 0) {
params.push(`--diff-filter=${filters.join(emptyStr)}`);
// Can't allow rename detection (`--follow`) if `all` or a `startLine` is specified
if (renames && (all || startLine != null)) {
renames = false;
}
if ((all !== true && renames) || firstParent) {
params.push(renames ? '--follow' : '-m');
if (/*renames ||*/ firstParent) {
params.push('--first-parent');
}
if (filters != null && filters.length !== 0) {
params.push(`--diff-filter=${filters.join(emptyStr)}`);
}
if (format !== 'refs') {
if (startLine == null) {
if (format === 'simple') {

+ 1
- 0
src/git/gitService.ts View File

@ -2189,6 +2189,7 @@ export class GitService implements Disposable {
const data = await Git.log__file(root, file, ref, {
...options,
firstParent: options.renames,
startLine: range == null ? undefined : range.start.line + 1,
endLine: range == null ? undefined : range.end.line + 1,
});

Loading…
Cancel
Save