gitlab_git 7.0.1 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ab5aa6578bdca193435e2b0c7341a0c050b2d8b
4
- data.tar.gz: b9d0126b99b6da231b0c45d7e0ef65962d8f6db5
3
+ metadata.gz: e4a8a135eb5358dd1b869c7838ef929d86de4293
4
+ data.tar.gz: 1f64c7ab0f98fcc4e5b0e93bb959d3b56d4cae08
5
5
  SHA512:
6
- metadata.gz: a568b6db546a15940023289f7a01c704dedfffb76616cc51cccec0a9c65bac06e96da48e3677d53a75eafaeaf18d649248932ffb014c1af48b5c37dbee9e87a0
7
- data.tar.gz: 90191aa864c638784c91b4b20475d629df00d7911e471c1a5c1858baea637327501f701966790f97d5cc20511aabf76eca6b5fa8f3046689247e015ce873e0b5
6
+ metadata.gz: 2a1e73582ca20fa80bdb6d1c7b337864f9cdf412b751b4bc3f32f3982f0afc6e8f021f909b44fa6224f53a88d050d96086216036c5b66404f5f64c1ad226e48c
7
+ data.tar.gz: 36a067ae07f4700f32a55216c51bd071f4047ddc95b7612222381e62dc1c05426c39e5a684bf89c0454542c2fb448aa9f8ccdd3cd5662a3880057c2820facbaa
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.0.1
1
+ 7.1.0
@@ -1,12 +1,13 @@
1
1
  module Gitlab
2
2
  module Git
3
3
  class Blame
4
+ attr_accessor :blob
4
5
 
5
6
  def initialize(repository, sha, path)
6
7
  @repo = repository.rugged
7
- @blame = Rugged::Blame.new(@repo, path, { :newest_commit => sha })
8
- @blob = @repo.blob_at(sha, path)
9
- @lines = @blob.content.split("\n")
8
+ @blame = Rugged::Blame.new(@repo, path, { newest_commit: sha })
9
+ @blob = Blob.find(repository, sha, path)
10
+ @lines = @blob.data.split("\n")
10
11
  end
11
12
 
12
13
  def each
@@ -2,6 +2,8 @@
2
2
  module Gitlab
3
3
  module Git
4
4
  class Commit
5
+ include EncodingHelper
6
+
5
7
  attr_accessor :raw_commit, :head, :refs
6
8
 
7
9
  SERIALIZE_KEYS = [
@@ -248,6 +250,26 @@ module Gitlab
248
250
  end
249
251
  end
250
252
 
253
+ def message
254
+ encode! @message
255
+ end
256
+
257
+ def author_name
258
+ encode! @author_name
259
+ end
260
+
261
+ def author_email
262
+ encode! @author_email
263
+ end
264
+
265
+ def committer_name
266
+ encode! @committer_name
267
+ end
268
+
269
+ def committer_email
270
+ encode! @committer_email
271
+ end
272
+
251
273
  private
252
274
 
253
275
  def init_from_hash(hash)
@@ -231,4 +231,3 @@ module Gitlab
231
231
  end
232
232
  end
233
233
  end
234
-
@@ -27,7 +27,7 @@ module EncodingHelper
27
27
  private
28
28
 
29
29
  def clean(message)
30
- message.encode("UTF-16BE", :undef => :replace, :invalid => :replace, :replace => "")
30
+ message.encode("UTF-16BE", undef: :replace, invalid: :replace, replace: "")
31
31
  .encode("UTF-8")
32
32
  .gsub("\0".encode("UTF-8"), "")
33
33
  end
@@ -4,12 +4,12 @@ module Gitlab
4
4
  module Git
5
5
  module Popen
6
6
  def popen(cmd, path)
7
- unless cmd.is_a?(Array)
8
- raise "System commands must be given as an array of strings"
9
- end
7
+ unless cmd.is_a?(Array)
8
+ raise "System commands must be given as an array of strings"
9
+ end
10
10
 
11
11
  vars = { "PWD" => path }
12
- options = { :chdir => path }
12
+ options = { chdir: path }
13
13
 
14
14
  @cmd_output = ""
15
15
  @cmd_status = 0
@@ -1,6 +1,8 @@
1
1
  module Gitlab
2
2
  module Git
3
3
  class Ref
4
+ include EncodingHelper
5
+
4
6
  # Branch or tag name
5
7
  # without "refs/tags|heads" prefix
6
8
  attr_reader :name
@@ -19,6 +21,7 @@ module Gitlab
19
21
  end
20
22
 
21
23
  def initialize(name, target)
24
+ encode! name
22
25
  @name = name.gsub(/\Arefs\/(tags|heads)\//, '')
23
26
  @target = if target.respond_to?(:oid)
24
27
  target.oid
@@ -202,7 +202,11 @@ module Gitlab
202
202
  # Discard submodules
203
203
  next if submodule?(entry)
204
204
 
205
- content = rugged.lookup(entry[:oid]).content
205
+ content = Blob.raw(self, entry[:oid]).data
206
+
207
+ # Skip binary files
208
+ next if content.encoding == Encoding::ASCII_8BIT
209
+
206
210
  greps += build_greps(content, query, ref, entry[:path])
207
211
  end
208
212
 
@@ -899,7 +903,7 @@ module Gitlab
899
903
 
900
904
  # Get the compression process ready to accept data from the read end
901
905
  # of the pipe
902
- compress_pid = spawn(*compress_cmd, :in => pipe_rd, :out => file)
906
+ compress_pid = spawn(*compress_cmd, in: pipe_rd, out: file)
903
907
  # Set the lowest priority for the compressing process
904
908
  popen(nice_process(compress_pid), path)
905
909
  # The read end belongs to the compression process now; we should
@@ -908,7 +912,7 @@ module Gitlab
908
912
 
909
913
  # Start 'git archive' and tell it to write into the write end of the
910
914
  # pipe.
911
- git_archive_pid = spawn(*git_archive_cmd, :out => pipe_wr)
915
+ git_archive_pid = spawn(*git_archive_cmd, out: pipe_wr)
912
916
  # The write end belongs to 'git archive' now; close it.
913
917
  pipe_wr.close
914
918
 
@@ -1,12 +1,14 @@
1
1
  module Gitlab
2
2
  module Git
3
3
  class Tag < Ref
4
- attr_reader :message
5
-
6
4
  def initialize(name, target, message = nil)
7
5
  super(name, target)
8
6
  @message = message
9
7
  end
8
+
9
+ def message
10
+ encode! @message
11
+ end
10
12
  end
11
13
  end
12
14
  end
@@ -1,6 +1,8 @@
1
1
  module Gitlab
2
2
  module Git
3
3
  class Tree
4
+ include EncodingHelper
5
+
4
6
  attr_accessor :id, :root_id, :name, :path, :type,
5
7
  :mode, :commit_id, :submodule_url
6
8
 
@@ -74,6 +76,10 @@ module Gitlab
74
76
  end
75
77
  end
76
78
 
79
+ def name
80
+ encode! @name
81
+ end
82
+
77
83
  def dir?
78
84
  type == :tree
79
85
  end
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: 7.0.1
4
+ version: 7.1.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: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab-linguist