gitlab-grit 2.5.1 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gitlab-grit might be problematic. Click here for more details.

Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/grit/git.rb +8 -2
  3. data/lib/grit/repo.rb +3 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f453ada29206a7deeb55fe63bba1105a9ee67fe5
4
- data.tar.gz: d593185fb02934345a4835b3c5c2088aefb6d5fd
3
+ metadata.gz: e01843f1f907d4f805ebe1a462b2b9ef8d9eaab5
4
+ data.tar.gz: b9f43ffa1683eaf547231ed43669af157f8164c4
5
5
  SHA512:
6
- metadata.gz: 056b694f2fc7938a97c142461d3b29a493c0aba78344bf15808bf42b9cc42af0c2c437bb5852b9b22db65d057ff8abfb4b73c0caac14354efc0f1cf244c64031
7
- data.tar.gz: d56d89a626aee898ffca47a4e08aa8fd85c75fe14f3bf9d0beff6ffe611b78a7e2ffaa56f63853224ef20b6bd4bb9ccb29a0b3e0f28694ca14be1e9932beaeeb
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
- return run(prefix, cmd, '', options, args) if args[-1].to_s[0] == ?|
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-grit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner