git 2.3.2 → 2.3.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4c3080ee5b1fd4b591abe1e3e94917ea4307c97a3cf75f93cbc910e5320142b
4
- data.tar.gz: 1b5a4682825b282577918929d21967846191fdcf16a8dc3c72de71820fee74f9
3
+ metadata.gz: 5bc80ed5447f019e983721b8d5b9658be3acda92512312f81d9cad47d7b751e1
4
+ data.tar.gz: 3cfb80132b7dc28a0e10f7513e688bf8b43bc0786460cdfc93d00ce547533e83
5
5
  SHA512:
6
- metadata.gz: 57434c5742779e9769f3a6ce85a5b25c5f3c4e5974427965bca0df4922a266ffb3225839ccf2964f2391d5b8c7eda68de4aa1d46bbbd264b6d5c53a2c7852f77
7
- data.tar.gz: 6c1a1bc6010f883eb8b0d4ccd677a5f46c98db9f3f9e582b8c06f6b4294903c1949fe288fe2ae2c17c41ae9e5319fdc9fc64870e5f3f1219b03351a22f475d4c
6
+ metadata.gz: 86e89789bc17358bf813f46896bb509491b8db027104d440c0a3e8f7bb7716da0c76d6a264a589e188a1e7d5331c833d5b161536a6bd6dccf44ef3df64b6c780
7
+ data.tar.gz: 8e54f34cb83b0d3027870b1eea35eb23896cd572fc23c167655fb308e15e19ac3a24f7c7c5173fdb734aacfe410516d2bf2793baf4660b443a049a3259176cf0
data/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@
5
5
 
6
6
  # Change Log
7
7
 
8
+ ## v2.3.3 (2024-12-04)
9
+
10
+ [Full Changelog](https://github.com/ruby-git/ruby-git/compare/v2.3.2..v2.3.3)
11
+
12
+ Changes since v2.3.2:
13
+
14
+ * c25e5e0 test: add tests for spaces in the git binary path or the working dir
15
+ * 5f43a1a fix: open3 errors on binary paths with spaces
16
+ * 60b58ba test: add #run_command for tests to use instead of backticks
17
+
8
18
  ## v2.3.2 (2024-11-19)
9
19
 
10
20
  [Full Changelog](https://github.com/ruby-git/ruby-git/compare/v2.3.1..v2.3.2)
data/lib/git/base.rb CHANGED
@@ -37,9 +37,15 @@ module Git
37
37
  end
38
38
 
39
39
  def self.binary_version(binary_path)
40
- git_cmd = "#{binary_path} -c core.quotePath=true -c color.ui=false version 2>&1"
41
- result, status = Open3.capture2(git_cmd)
42
- result = result.chomp
40
+ result = nil
41
+ status = nil
42
+
43
+ begin
44
+ result, status = Open3.capture2e(binary_path, "-c", "core.quotePath=true", "-c", "color.ui=false", "version")
45
+ result = result.chomp
46
+ rescue Errno::ENOENT
47
+ raise RuntimeError, "Failed to get git version: #{binary_path} not found"
48
+ end
43
49
 
44
50
  if status.success?
45
51
  version = result[/\d+(\.\d+)+/]
@@ -81,9 +87,14 @@ module Git
81
87
  result = working_dir
82
88
  status = nil
83
89
 
84
- git_cmd = "#{Git::Base.config.binary_path} -c core.quotePath=true -c color.ui=false rev-parse --show-toplevel 2>&1"
85
- result, status = Open3.capture2(git_cmd, chdir: File.expand_path(working_dir))
86
- result = result.chomp
90
+ raise ArgumentError, "'#{working_dir}' does not exist" unless Dir.exist?(working_dir)
91
+
92
+ begin
93
+ result, status = Open3.capture2e(Git::Base.config.binary_path, "-c", "core.quotePath=true", "-c", "color.ui=false", "rev-parse", "--show-toplevel", chdir: File.expand_path(working_dir))
94
+ result = result.chomp
95
+ rescue Errno::ENOENT
96
+ raise ArgumentError, "Failed to find the root of the worktree: git binary not found"
97
+ end
87
98
 
88
99
  raise ArgumentError, "'#{working_dir}' is not in a git working tree" unless status.success?
89
100
  result
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='2.3.2'
4
+ VERSION='2.3.3'
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: 2.3.2
4
+ version: 2.3.3
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: 2024-11-19 00:00:00.000000000 Z
11
+ date: 2024-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -243,8 +243,8 @@ licenses:
243
243
  metadata:
244
244
  homepage_uri: http://github.com/ruby-git/ruby-git
245
245
  source_code_uri: http://github.com/ruby-git/ruby-git
246
- changelog_uri: https://rubydoc.info/gems/git/2.3.2/file/CHANGELOG.md
247
- documentation_uri: https://rubydoc.info/gems/git/2.3.2
246
+ changelog_uri: https://rubydoc.info/gems/git/2.3.3/file/CHANGELOG.md
247
+ documentation_uri: https://rubydoc.info/gems/git/2.3.3
248
248
  post_install_message:
249
249
  rdoc_options: []
250
250
  require_paths: