git 4.4.1 → 4.4.2
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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/lib/git/base.rb +38 -27
- data/lib/git/lib.rb +0 -1
- data/lib/git/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a068310fe357011fc394084d24264d30f7130dfea211dfc6a2ba5aff40d4c93
|
|
4
|
+
data.tar.gz: 7bd159311bc13ff18518828bbd9ea43da0435d3d1e13fc0762da69540f163c6a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2b616a55aac28d2c32097a2cdd14ee8f435ddba1c611393e053841f60deb3af30fd941673af433966378325a91feb280226bf511e67836b95895dfff2505dd9
|
|
7
|
+
data.tar.gz: 6a3c14186bc35d50905892ac333c0c3a7431199c670eaaa1101b56c60344a3fb01ff3f7ca2b7e35f14a7d4e1bb2701bd55c8a0050c58ebbcb5eafd82c3d0495b
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
# Change Log
|
|
7
7
|
|
|
8
|
+
## [4.4.2](https://github.com/ruby-git/ruby-git/compare/v4.4.1...v4.4.2) (2026-08-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Run the Git.open bootstrap commands without redirecting stdin ([65de0fe](https://github.com/ruby-git/ruby-git/commit/65de0fe88bca34ad3de366ee9a212653de37fc6d)), closes [#840](https://github.com/ruby-git/ruby-git/issues/840)
|
|
14
|
+
|
|
8
15
|
## [4.4.1](https://github.com/ruby-git/ruby-git/compare/v4.4.0...v4.4.1) (2026-08-09)
|
|
9
16
|
|
|
10
17
|
|
data/lib/git/base.rb
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'logger'
|
|
4
|
-
require 'open3'
|
|
5
4
|
|
|
6
5
|
module Git
|
|
7
6
|
# The main public interface for interacting with Git commands
|
|
@@ -41,21 +40,14 @@ module Git
|
|
|
41
40
|
end
|
|
42
41
|
|
|
43
42
|
def self.binary_version(binary_path)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
raise "Failed to get git version: #{status}\n#{result}" unless status.success?
|
|
47
|
-
|
|
48
|
-
parse_version_string(result)
|
|
43
|
+
parse_version_string(execute_git_version(binary_path))
|
|
49
44
|
end
|
|
50
45
|
|
|
51
46
|
private_class_method def self.execute_git_version(binary_path)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
'version'
|
|
57
|
-
)
|
|
58
|
-
rescue Errno::ENOENT
|
|
47
|
+
bootstrap_command_line(binary_path).run('version', merge: true).stdout
|
|
48
|
+
rescue Git::CommandLineError => e
|
|
49
|
+
raise "Failed to get git version: #{e.result.status}\n#{e.result.stdout}"
|
|
50
|
+
rescue Errno::ENOENT, ProcessExecuter::SpawnError
|
|
59
51
|
raise "Failed to get git version: #{binary_path} not found"
|
|
60
52
|
end
|
|
61
53
|
|
|
@@ -98,26 +90,45 @@ module Git
|
|
|
98
90
|
def self.root_of_worktree(working_dir)
|
|
99
91
|
raise ArgumentError, "'#{working_dir}' does not exist" unless Dir.exist?(working_dir)
|
|
100
92
|
|
|
101
|
-
|
|
102
|
-
process_rev_parse_result(result, status, working_dir)
|
|
93
|
+
execute_rev_parse_toplevel(working_dir)
|
|
103
94
|
end
|
|
104
95
|
|
|
105
96
|
private_class_method def self.execute_rev_parse_toplevel(working_dir)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
)
|
|
113
|
-
rescue Errno::ENOENT
|
|
97
|
+
bootstrap_command_line(Git::Base.config.binary_path).run(
|
|
98
|
+
'rev-parse', '--show-toplevel', chdir: File.expand_path(working_dir), merge: true, chomp: true
|
|
99
|
+
).stdout
|
|
100
|
+
rescue Git::CommandLineError
|
|
101
|
+
raise ArgumentError, "'#{working_dir}' is not in a git working tree"
|
|
102
|
+
rescue Errno::ENOENT, ProcessExecuter::SpawnError
|
|
114
103
|
raise ArgumentError, 'Failed to find the root of the worktree: git binary not found'
|
|
115
104
|
end
|
|
116
105
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
106
|
+
# A command line for the git commands that run before a repository is known
|
|
107
|
+
#
|
|
108
|
+
# `Open3` is deliberately not used here. Windows has no fork, so
|
|
109
|
+
# `Process.spawn` implements a redirect of the child's stdin by redirecting
|
|
110
|
+
# the *parent's* stdin and restoring it afterward, which replaces the
|
|
111
|
+
# process's stdin handle. That leaves a console REPL such as irb or pry
|
|
112
|
+
# unable to read input for the rest of the session. `Git::CommandLine`
|
|
113
|
+
# redirects only stdout and stderr, so stdin is never disturbed.
|
|
114
|
+
#
|
|
115
|
+
# @see https://github.com/ruby-git/ruby-git/issues/840 issue 840
|
|
116
|
+
#
|
|
117
|
+
# @param binary_path [String] the path to the git binary to run
|
|
118
|
+
#
|
|
119
|
+
# @return [Git::CommandLine] a command line that runs `binary_path` with
|
|
120
|
+
# `-c core.quotePath=true -c color.ui=false`
|
|
121
|
+
#
|
|
122
|
+
# Those are the options the `Open3` calls this replaced passed, kept as they were
|
|
123
|
+
# so these two commands behave exactly as before. Neither `git version` nor
|
|
124
|
+
# `git rev-parse --show-toplevel` emits colored output, so the remaining `color.*`
|
|
125
|
+
# settings in {Git::Lib}'s `STATIC_GLOBAL_OPTS` are not needed here.
|
|
126
|
+
#
|
|
127
|
+
# @api private
|
|
128
|
+
#
|
|
129
|
+
private_class_method def self.bootstrap_command_line(binary_path)
|
|
130
|
+
Git::CommandLine.new({}, binary_path, ['-c', 'core.quotePath=true', '-c', 'color.ui=false'],
|
|
131
|
+
Logger.new(nil))
|
|
121
132
|
end
|
|
122
133
|
|
|
123
134
|
# (see Git.open)
|
data/lib/git/lib.rb
CHANGED
data/lib/git/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: git
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.4.
|
|
4
|
+
version: 4.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Scott Chacon and others
|
|
@@ -310,8 +310,8 @@ licenses:
|
|
|
310
310
|
metadata:
|
|
311
311
|
homepage_uri: http://github.com/ruby-git/ruby-git
|
|
312
312
|
source_code_uri: http://github.com/ruby-git/ruby-git
|
|
313
|
-
changelog_uri: https://rubydoc.info/gems/git/4.4.
|
|
314
|
-
documentation_uri: https://rubydoc.info/gems/git/4.4.
|
|
313
|
+
changelog_uri: https://rubydoc.info/gems/git/4.4.2/file/CHANGELOG.md
|
|
314
|
+
documentation_uri: https://rubydoc.info/gems/git/4.4.2
|
|
315
315
|
rubygems_mfa_required: 'true'
|
|
316
316
|
rdoc_options: []
|
|
317
317
|
require_paths:
|