gitlab_git 7.2.24 → 8.0.0
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/gitlab_git/blob.rb +15 -2
- data/lib/gitlab_git/repository.rb +5 -4
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: d950876f8ec96a748af722a6415f180df67145e3
         | 
| 4 | 
            +
              data.tar.gz: ba58a4d6062538028df751d1f4c1d5ecc753c588
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e99e08238b47ce5b23a715c7578fe98d2f29cf755e5cff28b688bcf5195447577354d14fd9a895530bde7b5959943906b93429bf331a4c7ad5be4616ea505083
         | 
| 7 | 
            +
              data.tar.gz: 0b39c79a5f3f723509a26d81fd7b8370de336a0487caacc3147588eb8c95268843e2e93fe00ef2abad6cb3841666d4a6ef6e9a4c402851ced7ecd36449e5ea9b
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
             | 
| 1 | 
            +
            8.0.0
         | 
    
        data/lib/gitlab_git/blob.rb
    CHANGED
    
    | @@ -7,6 +7,11 @@ module Gitlab | |
| 7 7 | 
             
                  include Linguist::BlobHelper
         | 
| 8 8 | 
             
                  include EncodingHelper
         | 
| 9 9 |  | 
| 10 | 
            +
                  # This number needs to be large enough to allow reliable content /
         | 
| 11 | 
            +
                  # encoding detection (Linguist) and LFS pointer parsing. All other cases
         | 
| 12 | 
            +
                  # where we need full blob data should use load_all_data!.
         | 
| 13 | 
            +
                  DATA_FRAGMENT_SIZE = 1024
         | 
| 14 | 
            +
             | 
| 10 15 | 
             
                  attr_accessor :name, :path, :size, :data, :mode, :id, :commit_id
         | 
| 11 16 |  | 
| 12 17 | 
             
                  class << self
         | 
| @@ -28,7 +33,7 @@ module Gitlab | |
| 28 33 | 
             
                            id: blob.oid,
         | 
| 29 34 | 
             
                            name: blob_entry[:name],
         | 
| 30 35 | 
             
                            size: blob.size,
         | 
| 31 | 
            -
                            data: blob.content,
         | 
| 36 | 
            +
                            data: blob.content(DATA_FRAGMENT_SIZE),
         | 
| 32 37 | 
             
                            mode: blob_entry[:filemode].to_s(8),
         | 
| 33 38 | 
             
                            path: path,
         | 
| 34 39 | 
             
                            commit_id: sha,
         | 
| @@ -43,7 +48,7 @@ module Gitlab | |
| 43 48 | 
             
                      Blob.new(
         | 
| 44 49 | 
             
                        id: blob.oid,
         | 
| 45 50 | 
             
                        size: blob.size,
         | 
| 46 | 
            -
                        data: blob.content,
         | 
| 51 | 
            +
                        data: blob.content(DATA_FRAGMENT_SIZE),
         | 
| 47 52 | 
             
                      )
         | 
| 48 53 | 
             
                    end
         | 
| 49 54 |  | 
| @@ -217,6 +222,14 @@ module Gitlab | |
| 217 222 | 
             
                    encode! @data
         | 
| 218 223 | 
             
                  end
         | 
| 219 224 |  | 
| 225 | 
            +
                  # Load all blob data (not just the first DATA_FRAGMENT_SIZE bytes) into
         | 
| 226 | 
            +
                  # memory as a Ruby string.
         | 
| 227 | 
            +
                  def load_all_data!(repository)
         | 
| 228 | 
            +
                    return if @data == '' # don't mess with submodule blobs
         | 
| 229 | 
            +
             | 
| 230 | 
            +
                    @data = repository.lookup(id).content
         | 
| 231 | 
            +
                  end
         | 
| 232 | 
            +
             | 
| 220 233 | 
             
                  def name
         | 
| 221 234 | 
             
                    encode! @name
         | 
| 222 235 | 
             
                  end
         | 
| @@ -197,7 +197,7 @@ module Gitlab | |
| 197 197 |  | 
| 198 198 | 
             
                  # Return repo size in megabytes
         | 
| 199 199 | 
             
                  def size
         | 
| 200 | 
            -
                    size = popen(%W(du - | 
| 200 | 
            +
                    size = popen(%W(du -sk), path).first.strip.to_i
         | 
| 201 201 | 
             
                    (size.to_f / 1024).round(2)
         | 
| 202 202 | 
             
                  end
         | 
| 203 203 |  | 
| @@ -211,12 +211,13 @@ module Gitlab | |
| 211 211 | 
             
                      # Discard submodules
         | 
| 212 212 | 
             
                      next if submodule?(entry)
         | 
| 213 213 |  | 
| 214 | 
            -
                       | 
| 214 | 
            +
                      blob = Blob.raw(self, entry[:oid])
         | 
| 215 215 |  | 
| 216 216 | 
             
                      # Skip binary files
         | 
| 217 | 
            -
                      next if  | 
| 217 | 
            +
                      next if blob.data.encoding == Encoding::ASCII_8BIT
         | 
| 218 218 |  | 
| 219 | 
            -
                       | 
| 219 | 
            +
                      blob.load_all_data!(self)
         | 
| 220 | 
            +
                      greps += build_greps(blob.data, query, ref, entry[:path])
         | 
| 220 221 | 
             
                    end
         | 
| 221 222 |  | 
| 222 223 | 
             
                    greps
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: gitlab_git
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version:  | 
| 4 | 
            +
              version: 8.0.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Dmitriy Zaporozhets
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016- | 
| 11 | 
            +
            date: 2016-02-02 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: github-linguist
         | 
| @@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 109 109 | 
             
                  version: '0'
         | 
| 110 110 | 
             
            requirements: []
         | 
| 111 111 | 
             
            rubyforge_project: 
         | 
| 112 | 
            -
            rubygems_version: 2.4. | 
| 112 | 
            +
            rubygems_version: 2.4.5.1
         | 
| 113 113 | 
             
            signing_key: 
         | 
| 114 114 | 
             
            specification_version: 4
         | 
| 115 115 | 
             
            summary: Gitlab::Git library
         |