git 1.13.1 → 1.13.2

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
  SHA256:
3
- metadata.gz: 8d000b5ac2ceebebeb6c84eae6aa1c6f4b3d58dd444f15c70390baadf7bb3c8e
4
- data.tar.gz: f45ef489fb3aa2d3cff1a45cb127bb27fe380693af5e322220322fd8aa6dfd33
3
+ metadata.gz: 29b8c6b76f613f41bcddf2786fe9b164ef2168f265f3b8fdccb9f8f4ead52669
4
+ data.tar.gz: b0f66b11fd1a2eba3640bfa42ff842dcfbd52ab30455026b97ebecad8fd86f0c
5
5
  SHA512:
6
- metadata.gz: 6128142518501bce8bd4e5f40e178ac063359916daf544005bdc6187160619b74c6236a7f56b29438f3b5ebb547a5759b59b3140ee260ebd179bc8a4124d1a15
7
- data.tar.gz: 56e9d4940992d8feab68502815563d6d16967c1d659748271bdd27e0e1a382f81ce4be4dd7682645b562f8b616be791f79437fdaaa072778aca724c91e40b4d1
6
+ metadata.gz: bb85d50e45a905b7e71617da29f6194e478b17aed237237e0dd53066a5182c328d4e992494a3b7d26df47223c0e601733400e62d04b7e9fffdf8993c22cd2fb5
7
+ data.tar.gz: ee9d9edbd87615caee4cc073acd2df9a047b46d5ba117997f193a98d28374d214e2994018d3bed10c0e4acad7cd913ba39da25ecc2b0fd973863930f19d0f129
data/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@
5
5
 
6
6
  # Change Log
7
7
 
8
+ ## v1.13.2 (2023-02-02)
9
+
10
+ [Full Changelog](https://github.com/ruby-git/ruby-git/compare/v1.13.1..v1.13.2)
11
+
12
+ Changes since v1.13.1:
13
+
14
+ * b6e031d Fix `Git::Lib#commit_data` for GPG-signed commits (#610)
15
+ * b12b820 Fix escaped path decoding (#612)
16
+
8
17
  ## v1.13.1 (2023-01-12)
9
18
 
10
19
  [Full Changelog](https://github.com/ruby-git/ruby-git/compare/v1.13.0...v1.13.1)
@@ -42,7 +42,7 @@ module Git
42
42
  private
43
43
 
44
44
  def extract_octal(path, index)
45
- [path[index + 1..index + 4].to_i(8), 4]
45
+ [path[index + 1..index + 3].to_i(8), 4]
46
46
  end
47
47
 
48
48
  def extract_escape(path, index)
data/lib/git/lib.rb CHANGED
@@ -221,54 +221,57 @@ module Git
221
221
  def commit_data(sha)
222
222
  sha = sha.to_s
223
223
  cdata = command_lines('cat-file', 'commit', sha)
224
- process_commit_data(cdata, sha, 0)
224
+ process_commit_data(cdata, sha)
225
225
  end
226
226
 
227
- def process_commit_data(data, sha = nil, indent = 4)
227
+ def process_commit_data(data, sha)
228
228
  hsh = {
229
- 'sha' => sha,
230
- 'message' => '',
231
- 'parent' => []
229
+ 'sha' => sha,
230
+ 'parent' => []
232
231
  }
233
232
 
234
- loop do
235
- key, *value = data.shift.split
236
-
237
- break if key.nil?
238
-
233
+ each_cat_file_header(data) do |key, value|
239
234
  if key == 'parent'
240
- hsh['parent'] << value.join(' ')
235
+ hsh['parent'] << value
241
236
  else
242
- hsh[key] = value.join(' ')
237
+ hsh[key] = value
243
238
  end
244
239
  end
245
240
 
246
- hsh['message'] = data.collect {|line| line[indent..-1]}.join("\n") + "\n"
241
+ hsh['message'] = data.join("\n") + "\n"
247
242
 
248
243
  return hsh
249
244
  end
250
245
 
246
+ CAT_FILE_HEADER_LINE = /\A(?<key>\w+) (?<value>.*)\z/
247
+
248
+ def each_cat_file_header(data)
249
+ while (match = CAT_FILE_HEADER_LINE.match(data.shift))
250
+ key = match[:key]
251
+ value_lines = [match[:value]]
252
+
253
+ while data.first.start_with?(' ')
254
+ value_lines << data.shift.lstrip
255
+ end
256
+
257
+ yield key, value_lines.join("\n")
258
+ end
259
+ end
260
+
251
261
  def tag_data(name)
252
262
  sha = sha.to_s
253
263
  tdata = command_lines('cat-file', 'tag', name)
254
- process_tag_data(tdata, name, 0)
264
+ process_tag_data(tdata, name)
255
265
  end
256
266
 
257
- def process_tag_data(data, name, indent=4)
258
- hsh = {
259
- 'name' => name,
260
- 'message' => ''
261
- }
262
-
263
- loop do
264
- key, *value = data.shift.split
265
-
266
- break if key.nil?
267
+ def process_tag_data(data, name)
268
+ hsh = { 'name' => name }
267
269
 
268
- hsh[key] = value.join(' ')
270
+ each_cat_file_header(data) do |key, value|
271
+ hsh[key] = value
269
272
  end
270
273
 
271
- hsh['message'] = data.collect {|line| line[indent..-1]}.join("\n") + "\n"
274
+ hsh['message'] = data.join("\n") + "\n"
272
275
 
273
276
  return hsh
274
277
  end
data/lib/git/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  # The current gem version
3
3
  # @return [String] the current gem version.
4
- VERSION='1.13.1'
4
+ VERSION='1.13.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.1
4
+ version: 1.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon and others
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  version: '0'
232
232
  requirements:
233
233
  - git 1.6.0.0, or greater
234
- rubygems_version: 3.3.26
234
+ rubygems_version: 3.4.1
235
235
  signing_key:
236
236
  specification_version: 4
237
237
  summary: An API to create, read, and manipulate Git repositories