grit icon indicating copy to clipboard operation
grit copied to clipboard

Grit::Repo.grep returns separated list if --\n is in file context

Open coverer opened this issue 11 years ago • 0 comments

The search of gitlab (and almost every other thing depending on grit) could be improved, when in lib/grit/repo.rb line 724 would be changed from

722       binary = false
723       file = ''
724        matches = filematch.split("--\n")
725        matches.each_with_index do |match, i|
726          content = []

to use a regexp instead of a string as split parameter

722       binary = false
723       file = ''
724        matches = filematch.split(/^--\n/)
725        matches.each_with_index do |match, i|
726          content = []

coverer avatar Jun 20 '13 12:06 coverer