lib/grit/repo.rb in gitlab-grit-2.5.2 vs lib/grit/repo.rb in gitlab-grit-2.6.0
- old
+ new
@@ -1,6 +1,7 @@
module Grit
+
class Repo
DAEMON_EXPORT_FILE = 'git-daemon-export-ok'
BATCH_PARSERS = {
'commit' => ::Grit::Commit
}
@@ -618,11 +619,10 @@
#
# Returns String (containing tar.gz archive)
def archive_tar_gz(treeish = 'master', prefix = nil)
options = {}
options[:prefix] = prefix if prefix
- options[:pipeline] = true
self.git.archive(options, treeish, "| gzip -n")
end
# Write an archive directly to a file
# +treeish+ is the treeish name/id (default 'master')
@@ -634,11 +634,10 @@
# Returns nothing
def archive_to_file(treeish = 'master', prefix = nil, filename = 'archive.tar.gz', format = nil, pipe = "gzip")
options = {}
options[:prefix] = prefix if prefix
options[:format] = format if format
- options[:pipeline] = true
self.git.archive(options, treeish, "| #{pipe} > #{filename}")
end
# Enable git-daemon serving of this repository by writing the
# git-daemon-export-ok file to its git directory
@@ -714,11 +713,11 @@
end
end
def grep(searchtext, contextlines = 3, branch = 'master')
context_arg = '-C ' + contextlines.to_s
- result = git.native(:grep, {pipeline: false}, '-n', '-E', '-i', '-z', '--heading', '--break', context_arg, searchtext, branch).force_encoding('UTF-8')
+ result = git.native(:grep, {}, '-n', '-E', '-i', '-z', '--heading', '--break', context_arg, searchtext, branch).encode('UTF-8', invalid: :replace, undef: :replace, replace: '')
greps = []
filematches = result.split("\n\n")
filematches.each do |filematch|
binary = false
file = ''
@@ -755,6 +754,7 @@
# Pretty object inspection
def inspect
%Q{#<Grit::Repo "#{@path}">}
end
end # Repo
+
end # Grit