gitlab_git 7.0.1 → 7.1.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/blame.rb +4 -3
- data/lib/gitlab_git/commit.rb +22 -0
- data/lib/gitlab_git/diff.rb +0 -1
- data/lib/gitlab_git/encoding_helper.rb +1 -1
- data/lib/gitlab_git/popen.rb +4 -4
- data/lib/gitlab_git/ref.rb +3 -0
- data/lib/gitlab_git/repository.rb +7 -3
- data/lib/gitlab_git/tag.rb +4 -2
- data/lib/gitlab_git/tree.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4a8a135eb5358dd1b869c7838ef929d86de4293
|
4
|
+
data.tar.gz: 1f64c7ab0f98fcc4e5b0e93bb959d3b56d4cae08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a1e73582ca20fa80bdb6d1c7b337864f9cdf412b751b4bc3f32f3982f0afc6e8f021f909b44fa6224f53a88d050d96086216036c5b66404f5f64c1ad226e48c
|
7
|
+
data.tar.gz: 36a067ae07f4700f32a55216c51bd071f4047ddc95b7612222381e62dc1c05426c39e5a684bf89c0454542c2fb448aa9f8ccdd3cd5662a3880057c2820facbaa
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.0
|
1
|
+
7.1.0
|
data/lib/gitlab_git/blame.rb
CHANGED
@@ -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, { :
|
8
|
-
@blob =
|
9
|
-
@lines = @blob.
|
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
|
data/lib/gitlab_git/commit.rb
CHANGED
@@ -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)
|
data/lib/gitlab_git/diff.rb
CHANGED
@@ -27,7 +27,7 @@ module EncodingHelper
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def clean(message)
|
30
|
-
message.encode("UTF-16BE", :
|
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
|
data/lib/gitlab_git/popen.rb
CHANGED
@@ -4,12 +4,12 @@ module Gitlab
|
|
4
4
|
module Git
|
5
5
|
module Popen
|
6
6
|
def popen(cmd, path)
|
7
|
-
|
8
|
-
|
9
|
-
|
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 = { :
|
12
|
+
options = { chdir: path }
|
13
13
|
|
14
14
|
@cmd_output = ""
|
15
15
|
@cmd_status = 0
|
data/lib/gitlab_git/ref.rb
CHANGED
@@ -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 =
|
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, :
|
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, :
|
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
|
|
data/lib/gitlab_git/tag.rb
CHANGED
data/lib/gitlab_git/tree.rb
CHANGED
@@ -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
|
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-
|
11
|
+
date: 2015-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab-linguist
|