git-grep: fix for initial dashes in expressions
There is no reason to reject initial dashes in git-grep expressions... other than the code not supporting it previously. A new method is introduced to relax the security checks.
This commit is contained in:
parent
0d2efa2c4a
commit
f4d86b4ab0
4 changed files with 45 additions and 1 deletions
|
@ -76,7 +76,7 @@ func GrepSearch(ctx context.Context, repo *Repository, search string, opts GrepO
|
|||
words = strings.Fields(search)
|
||||
}
|
||||
for _, word := range words {
|
||||
cmd.AddOptionValues("-e", strings.TrimLeft(word, "-"))
|
||||
cmd.AddGitGrepExpression(word)
|
||||
}
|
||||
|
||||
// pathspec
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue