git 1.12.0 → 1.13.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '03386fbc4d48647754608adba467800440ec80e5e8aecddac930a3e2565827bd'
4
- data.tar.gz: 180866b01d05c40d495638ee8ddf2a1d8ca2e534250575c09c20728a2473855e
3
+ metadata.gz: df0d52946aa19627fbff62a47b86f694763e957e1f6d87b9a5e14e6cae46ff1d
4
+ data.tar.gz: f2b9e31a9cfb944da55c25b22b54aacd54d788e77ef2808d7cfba0a466cedb8a
5
5
  SHA512:
6
- metadata.gz: b5115fff1ce7fbbc3a0fb8d22b8f27b6c3acb00e27613e3e8d0a4d760c2b40a0355a3c2e57e3e8d14e91545f985eea51caca44eab4b04b112f00393e64f48216
7
- data.tar.gz: 4494ee6206a07e17b2c1bb983c7519689364c1ec15bfa811a3ab4cf380aba9a29c783adfff82917c0379a7911b2a5a51d0661bf928f69d9502a271d8d11a846e
6
+ metadata.gz: 0a812bbdc6aabf7c63d30f96659edfe4a65a141dce613046d3f7e537f5105a80e48f6ae03cb30c4d806243cfd130b49bbc852f43df493191e26dfec2f03551f2
7
+ data.tar.gz: b0a634418e93055e3f3c2c5256176515aa990950f4927e2b0ee82055a87543f0695cf13ae4a1f5bd99ab1cec9f8e264153b8aa2ec3f4392c88c5890c17ce7c13
data/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@
5
5
 
6
6
  # Change Log
7
7
 
8
+ ## v1.13.0 (2022-12-10)
9
+
10
+ [Full Changelog](https://github.com/ruby-git/ruby-git/compare/v1.12.0...v1.13.0)
11
+
12
+ * 8349224 Update list of maintainers (#598)
13
+ * 4fe8738 In ls-files do not unescape file paths with eval (#602)
14
+ * 74b8e11 Add start_point option for checkout command (#597)
15
+ * ff6dcf4 Do not assume the default branch is 'master' in tests
16
+ * 8279298 Fix exception when Git is autoloaded (#594)
17
+
8
18
  ## v1.12.0
9
19
 
10
20
  See https://github.com/ruby-git/ruby-git/releases/tag/v1.12.0
@@ -151,4 +161,3 @@ See https://github.com/ruby-git/ruby-git/releases/tag/v1.4.0
151
161
  ## 1.0.1
152
162
 
153
163
  * Initial version
154
-
data/MAINTAINERS.md CHANGED
@@ -7,7 +7,6 @@
7
7
 
8
8
  When making changes in this repository, one of the maintainers below must review and approve your pull request.
9
9
 
10
- ### Maintainers
11
-
10
+ * [James Couball](https://github.com/jcouball)
11
+ * [Frank Throckmorton](https://github.com/frankthrock)
12
12
  * [Per Lundberg](https://github.com/perlun)
13
- * [James Couball](https://github.com/jcouball)
data/README.md CHANGED
@@ -265,6 +265,7 @@ g.branch('existing_branch').checkout
265
265
  g.branch('master').contains?('existing_branch')
266
266
 
267
267
  g.checkout('new_branch')
268
+ g.checkout('new_branch', new_branch: true, start_point: 'master')
268
269
  g.checkout(g.branch('new_branch'))
269
270
 
270
271
  g.branch(name).merge(branch2)
data/lib/git/lib.rb CHANGED
@@ -63,6 +63,8 @@ module Git
63
63
  @git_work_dir = base[:working_directory]
64
64
  end
65
65
  @logger = logger
66
+
67
+ Git::Lib.warn_if_old_command(self)
66
68
  end
67
69
 
68
70
  # creates or reinitializes the repository
@@ -486,7 +488,9 @@ module Git
486
488
  command_lines('ls-files', '--stage', location).each do |line|
487
489
  (info, file) = line.split("\t")
488
490
  (mode, sha, stage) = info.split
489
- file = eval(file) if file =~ /^\".*\"$/ # This takes care of quoted strings returned from git
491
+ if file.start_with?('"') && file.end_with?('"')
492
+ file = Git::EscapedPath.new(file[1..-2]).unescape
493
+ end
490
494
  hsh[file] = {:path => file, :mode_index => mode, :sha_index => sha, :stage => stage}
491
495
  end
492
496
  hsh
@@ -762,11 +766,21 @@ module Git
762
766
  command('branch', '-D', branch)
763
767
  end
764
768
 
769
+ # Runs checkout command to checkout or create branch
770
+ #
771
+ # accepts options:
772
+ # :new_branch
773
+ # :force
774
+ # :start_point
775
+ #
776
+ # @param [String] branch
777
+ # @param [Hash] opts
765
778
  def checkout(branch, opts = {})
766
779
  arr_opts = []
767
780
  arr_opts << '-b' if opts[:new_branch] || opts[:b]
768
781
  arr_opts << '--force' if opts[:force] || opts[:f]
769
782
  arr_opts << branch
783
+ arr_opts << opts[:start_point] if opts[:start_point] && arr_opts.include?('-b')
770
784
 
771
785
  command('checkout', arr_opts)
772
786
  end
@@ -1027,6 +1041,13 @@ module Git
1027
1041
  (self.current_command_version <=> self.required_command_version) >= 0
1028
1042
  end
1029
1043
 
1044
+ def self.warn_if_old_command(lib)
1045
+ return true if @version_checked
1046
+ unless lib.meets_required_version?
1047
+ $stderr.puts "[WARNING] The git gem requires git #{lib.required_command_version.join('.')} or later, but only found #{lib.current_command_version.join('.')}. You should probably upgrade."
1048
+ end
1049
+ @version_checked = true
1050
+ end
1030
1051
 
1031
1052
  private
1032
1053
 
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.12.0'
4
+ VERSION='1.13.0'
5
5
  end
data/lib/git.rb CHANGED
@@ -27,11 +27,6 @@ require 'git/working_directory'
27
27
  require 'git/worktree'
28
28
  require 'git/worktrees'
29
29
 
30
- lib = Git::Lib.new(nil, nil)
31
- unless lib.meets_required_version?
32
- $stderr.puts "[WARNING] The git gem requires git #{lib.required_command_version.join('.')} or later, but only found #{lib.current_command_version.join('.')}. You should probably upgrade."
33
- end
34
-
35
30
  # The Git module provides the basic functions to open a git
36
31
  # reference to work with. You can open a working directory,
37
32
  # open a bare repository, initialize a new repo or clone an
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.12.0
4
+ version: 1.13.0
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: 2022-08-18 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  version: '0'
218
218
  requirements:
219
219
  - git 1.6.0.0, or greater
220
- rubygems_version: 3.1.6
220
+ rubygems_version: 3.3.26
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: An API to create, read, and manipulate Git repositories