Browse Source

Fixes issues w/ quotes and commit search

main
Eric Amodio 2 years ago
parent
commit
b71b309964
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      src/git/providers/localGitProvider.ts

+ 7
- 3
src/git/providers/localGitProvider.ts View File

@ -1795,7 +1795,9 @@ export class LocalGitProvider implements GitProvider, Disposable {
searchArgs.add('--all-match');
}
for (const value of values) {
searchArgs.add(`--grep=${value.replace(doubleQuoteRegex, '\\b')}`);
searchArgs.add(
`--grep=${value.replace(doubleQuoteRegex, search.matchRegex ? '\\b' : '')}`,
);
}
break;
@ -1803,14 +1805,16 @@ export class LocalGitProvider implements GitProvider, Disposable {
case 'author:':
searchArgs.add('-m');
for (const value of values) {
searchArgs.add(`--author=${value.replace(doubleQuoteRegex, '\\b')}`);
searchArgs.add(
`--author=${value.replace(doubleQuoteRegex, search.matchRegex ? '\\b' : '')}`,
);
}
break;
case 'change:':
for (const value of values) {
searchArgs.add(`-G${value}`);
searchArgs.add(`-G${value.replace(doubleQuoteRegex, '')}`);
}
break;

Loading…
Cancel
Save