lib/gitlab_git/repository.rb
def search_files(query, ref = nil)
        greps = []
        ref ||= root_ref

        populated_index(ref).each do |entry|
          # Discard submodules
          next if submodule?(entry)

          content = Blob.raw(self, entry[:oid]).data

          # Skip binary files
          next if content.encoding == Encoding::ASCII_8BIT

          greps += build_greps(content, query, ref, entry[:path])
        end

        greps
      end
# Returns an array of BlobSnippets for files at the specified +ref+ that
# contain the +query+ string.
Returns an array of BlobSnippets for files at the specified +ref+ that
contain the +query+ string.
Returns an array of BlobSnippets for files at the specified + ref + that contain the + query + string .
def search_files(query, ref = nil)
        greps = []
        ref ||= root_ref
        populated_index(ref).each do |entry|
          next if submodule?(entry)
          content = Blob.raw(self, entry[:oid]).data
          next if content.encoding == Encoding::ASCII_8BIT
          greps += build_greps(content, query, ref, entry[:path])
        end
        greps
      end
def search_files ( query , ref = nil ) greps = [ ] ref ||= root_ref populated_index ( ref ) . each do | entry | next if submodule? ( entry ) content = Blob . raw ( self , entry [ :oid ] ) . data next if content . encoding == Encoding :: ASCII_8BIT greps += build_greps ( content , query , ref , entry [ :path ] ) end greps end
Returns an array of BlobSnippets for files at the specified +ref+ that
contain the +query+ string.
Returns an array of BlobSnippets for files at the specified + ref + that contain the + query + string .
# Discard submodules # Skip binary files
query
ref