gitlab-grit 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gitlab-grit might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/grit/git.rb +8 -2
- data/lib/grit/repo.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e01843f1f907d4f805ebe1a462b2b9ef8d9eaab5
|
4
|
+
data.tar.gz: b9f43ffa1683eaf547231ed43669af157f8164c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b24104f75bfe51628548effd17d98df9f5a0afd5b21b78e46014dfdfaec6429e6af233b8e6eb23c0d94854886a4129cb06b046c1b0995e59575a0ba950e4f8a9
|
7
|
+
data.tar.gz: f2d909494083105615098ff61a57da78b7ff4a041b214286fb5c3d5b0c5a0cb1717d8b71e9fddb7d8909fe7bd70e9a1115fdb71d1e46bb94cbc696eb31247941
|
data/lib/grit/git.rb
CHANGED
@@ -319,10 +319,13 @@ module Grit
|
|
319
319
|
env = options.delete(:env) || {}
|
320
320
|
raise_errors = options.delete(:raise)
|
321
321
|
process_info = options.delete(:process_info)
|
322
|
+
pipeline = options.delete(:pipeline)
|
322
323
|
|
323
324
|
# fall back to using a shell when the last argument looks like it wants to
|
324
325
|
# start a pipeline for compatibility with previous versions of grit.
|
325
|
-
|
326
|
+
if args[-1].to_s[0] == ?| && pipeline
|
327
|
+
return run(prefix, cmd, '', options, args)
|
328
|
+
end
|
326
329
|
|
327
330
|
# more options
|
328
331
|
input = options.delete(:input)
|
@@ -418,7 +421,10 @@ module Grit
|
|
418
421
|
end
|
419
422
|
|
420
423
|
# DEPRECATED OPEN3-BASED COMMAND EXECUTION
|
421
|
-
|
424
|
+
# Used only for pipeline support.
|
425
|
+
# Ex.
|
426
|
+
# git log | grep bugfix
|
427
|
+
#
|
422
428
|
def run(prefix, cmd, postfix, options, args, &block)
|
423
429
|
timeout = options.delete(:timeout) rescue nil
|
424
430
|
timeout = true if timeout.nil?
|
data/lib/grit/repo.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
module Grit
|
2
|
-
|
3
2
|
class Repo
|
4
3
|
DAEMON_EXPORT_FILE = 'git-daemon-export-ok'
|
5
4
|
BATCH_PARSERS = {
|
@@ -621,6 +620,7 @@ module Grit
|
|
621
620
|
def archive_tar_gz(treeish = 'master', prefix = nil)
|
622
621
|
options = {}
|
623
622
|
options[:prefix] = prefix if prefix
|
623
|
+
options[:pipeline] = true
|
624
624
|
self.git.archive(options, treeish, "| gzip -n")
|
625
625
|
end
|
626
626
|
|
@@ -636,6 +636,7 @@ module Grit
|
|
636
636
|
options = {}
|
637
637
|
options[:prefix] = prefix if prefix
|
638
638
|
options[:format] = format if format
|
639
|
+
options[:pipeline] = true
|
639
640
|
self.git.archive(options, treeish, "| #{pipe} > #{filename}")
|
640
641
|
end
|
641
642
|
|
@@ -715,7 +716,7 @@ module Grit
|
|
715
716
|
|
716
717
|
def grep(searchtext, contextlines = 3, branch = 'master')
|
717
718
|
context_arg = '-C ' + contextlines.to_s
|
718
|
-
result = git.native(:grep, {}, '-n', '-E', '-i', '-z', '--heading', '--break', context_arg, searchtext, branch).force_encoding('UTF-8')
|
719
|
+
result = git.native(:grep, {pipeline: false}, '-n', '-E', '-i', '-z', '--heading', '--break', context_arg, searchtext, branch).force_encoding('UTF-8')
|
719
720
|
greps = []
|
720
721
|
filematches = result.split("\n\n")
|
721
722
|
filematches.each do |filematch|
|
@@ -756,5 +757,4 @@ module Grit
|
|
756
757
|
%Q{#<Grit::Repo "#{@path}">}
|
757
758
|
end
|
758
759
|
end # Repo
|
759
|
-
|
760
760
|
end # Grit
|