mirror of https://git.jolheiser.com/ugit.git
parent
00b0d91307
commit
11d534f89f
|
@ -18,8 +18,10 @@ type GrepResult struct {
|
|||
|
||||
// Grep performs a naive "code search" via git grep
|
||||
func (r Repo) Grep(search string) ([]GrepResult, error) {
|
||||
// Plain-text search only
|
||||
re, err := regexp.Compile(regexp.QuoteMeta(search))
|
||||
if strings.HasPrefix(search, "=") {
|
||||
search = regexp.QuoteMeta(strings.TrimPrefix(search, "="))
|
||||
}
|
||||
re, err := regexp.Compile(search)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue