lib/grit/repo.rb in gitlab-grit-2.6.0 vs lib/grit/repo.rb in gitlab-grit-2.6.1
- old
+ new
@@ -1,7 +1,6 @@
module Grit
-
class Repo
DAEMON_EXPORT_FILE = 'git-daemon-export-ok'
BATCH_PARSERS = {
'commit' => ::Grit::Commit
}
@@ -619,10 +618,11 @@
#
# 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,10 +634,11 @@
# 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
@@ -713,11 +714,11 @@
end
end
def grep(searchtext, contextlines = 3, branch = 'master')
context_arg = '-C ' + contextlines.to_s
- result = git.native(:grep, {}, '-n', '-E', '-i', '-z', '--heading', '--break', context_arg, searchtext, branch).encode('UTF-8', invalid: :replace, undef: :replace, replace: '')
+ result = git.native(:grep, {pipeline: false}, '-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 = ''
@@ -754,7 +755,6 @@
# Pretty object inspection
def inspect
%Q{#<Grit::Repo "#{@path}">}
end
end # Repo
-
end # Grit