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
|
// Grep performs a naive "code search" via git grep
|
||||||
func (r Repo) Grep(search string) ([]GrepResult, error) {
|
func (r Repo) Grep(search string) ([]GrepResult, error) {
|
||||||
// Plain-text search only
|
if strings.HasPrefix(search, "=") {
|
||||||
re, err := regexp.Compile(regexp.QuoteMeta(search))
|
search = regexp.QuoteMeta(strings.TrimPrefix(search, "="))
|
||||||
|
}
|
||||||
|
re, err := regexp.Compile(search)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue