git 2.3.3 → 3.1.1
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/.commitlintrc.yml +38 -0
- data/.github/pull_request_template.md +1 -1
- data/.github/workflows/continuous_integration.yml +9 -5
- data/.github/workflows/enforce_conventional_commits.yml +28 -0
- data/.github/workflows/experimental_continuous_integration.yml +8 -1
- data/.github/workflows/release.yml +52 -0
- data/.gitignore +3 -0
- data/.husky/commit-msg +1 -0
- data/.release-please-manifest.json +3 -0
- data/.yardopts +0 -1
- data/CHANGELOG.md +65 -0
- data/CONTRIBUTING.md +104 -31
- data/README.md +44 -43
- data/Rakefile +7 -0
- data/git.gemspec +6 -6
- data/lib/git/author.rb +3 -2
- data/lib/git/base.rb +2 -0
- data/lib/git/branch.rb +2 -0
- data/lib/git/branches.rb +15 -14
- data/lib/git/command_line.rb +49 -139
- data/lib/git/config.rb +2 -0
- data/lib/git/diff.rb +2 -0
- data/lib/git/index.rb +2 -1
- data/lib/git/lib.rb +9 -4
- data/lib/git/log.rb +9 -2
- data/lib/git/object.rb +2 -0
- data/lib/git/path.rb +9 -8
- data/lib/git/remote.rb +2 -0
- data/lib/git/repository.rb +2 -0
- data/lib/git/stash.rb +7 -6
- data/lib/git/stashes.rb +11 -10
- data/lib/git/status.rb +3 -1
- data/lib/git/version.rb +3 -1
- data/lib/git/working_directory.rb +2 -0
- data/lib/git/worktree.rb +2 -0
- data/lib/git/worktrees.rb +2 -0
- data/lib/git.rb +2 -0
- data/package.json +10 -0
- data/release-please-config.json +36 -0
- metadata +24 -21
- data/RELEASING.md +0 -85
data/lib/git/branches.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Git
|
2
|
-
|
4
|
+
|
3
5
|
# object that holds all the available branches
|
4
6
|
class Branches
|
5
7
|
|
6
8
|
include Enumerable
|
7
|
-
|
9
|
+
|
8
10
|
def initialize(base)
|
9
11
|
@branches = {}
|
10
|
-
|
12
|
+
|
11
13
|
@base = base
|
12
|
-
|
14
|
+
|
13
15
|
@base.lib.branches_all.each do |b|
|
14
16
|
@branches[b[0]] = Git::Branch.new(@base, b[0])
|
15
17
|
end
|
@@ -18,21 +20,21 @@ module Git
|
|
18
20
|
def local
|
19
21
|
self.select { |b| !b.remote }
|
20
22
|
end
|
21
|
-
|
23
|
+
|
22
24
|
def remote
|
23
25
|
self.select { |b| b.remote }
|
24
26
|
end
|
25
|
-
|
27
|
+
|
26
28
|
# array like methods
|
27
29
|
|
28
30
|
def size
|
29
31
|
@branches.size
|
30
|
-
end
|
31
|
-
|
32
|
+
end
|
33
|
+
|
32
34
|
def each(&block)
|
33
35
|
@branches.values.each(&block)
|
34
36
|
end
|
35
|
-
|
37
|
+
|
36
38
|
# Returns the target branch
|
37
39
|
#
|
38
40
|
# Example:
|
@@ -50,14 +52,14 @@ module Git
|
|
50
52
|
@branches.values.inject(@branches) do |branches, branch|
|
51
53
|
branches[branch.full] ||= branch
|
52
54
|
|
53
|
-
# This is how Git (version 1.7.9.5) works.
|
54
|
-
# Lets you ignore the 'remotes' if its at the beginning of the branch full name (even if is not a real remote branch).
|
55
|
+
# This is how Git (version 1.7.9.5) works.
|
56
|
+
# Lets you ignore the 'remotes' if its at the beginning of the branch full name (even if is not a real remote branch).
|
55
57
|
branches[branch.full.sub('remotes/', '')] ||= branch if branch.full =~ /^remotes\/.+/
|
56
|
-
|
58
|
+
|
57
59
|
branches
|
58
60
|
end[branch_name.to_s]
|
59
61
|
end
|
60
|
-
|
62
|
+
|
61
63
|
def to_s
|
62
64
|
out = ''
|
63
65
|
@branches.each do |k, b|
|
@@ -65,7 +67,6 @@ module Git
|
|
65
67
|
end
|
66
68
|
out
|
67
69
|
end
|
68
|
-
|
69
70
|
end
|
70
71
|
|
71
72
|
end
|
data/lib/git/command_line.rb
CHANGED
@@ -189,13 +189,14 @@ module Git
|
|
189
189
|
#
|
190
190
|
# @raise [Git::TimeoutError] if the command times out
|
191
191
|
#
|
192
|
-
def run(*args, out
|
192
|
+
def run(*args, out: nil, err: nil, normalize:, chomp:, merge:, chdir: nil, timeout: nil)
|
193
193
|
git_cmd = build_git_cmd(args)
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
194
|
+
begin
|
195
|
+
result = ProcessExecuter.run(env, *git_cmd, out: out, err: err, merge:, chdir: (chdir || :not_set), timeout: timeout, raise_errors: false)
|
196
|
+
rescue ProcessExecuter::Command::ProcessIOError => e
|
197
|
+
raise Git::ProcessIOError.new(e.message), cause: e.exception.cause
|
198
|
+
end
|
199
|
+
process_result(result, normalize, chomp, timeout)
|
199
200
|
end
|
200
201
|
|
201
202
|
private
|
@@ -210,121 +211,12 @@ module Git
|
|
210
211
|
[binary_path, *global_opts, *args].map { |e| e.to_s }
|
211
212
|
end
|
212
213
|
|
213
|
-
# Determine the output to return in the `CommandLineResult`
|
214
|
-
#
|
215
|
-
# If the writer can return the output by calling `#string` (such as a StringIO),
|
216
|
-
# then return the result of normalizing the encoding and chomping the output
|
217
|
-
# as requested.
|
218
|
-
#
|
219
|
-
# If the writer does not support `#string`, then return nil. The output is
|
220
|
-
# assumed to be collected by the writer itself such as when the writer
|
221
|
-
# is a file instead of a StringIO.
|
222
|
-
#
|
223
|
-
# @param writer [#string] the writer to post-process
|
224
|
-
#
|
225
|
-
# @return [String, nil]
|
226
|
-
#
|
227
|
-
# @api private
|
228
|
-
#
|
229
|
-
def post_process(writer, normalize, chomp)
|
230
|
-
if writer.respond_to?(:string)
|
231
|
-
output = writer.string.dup
|
232
|
-
output = output.lines.map { |l| Git::EncodingUtils.normalize_encoding(l) }.join if normalize
|
233
|
-
output.chomp! if chomp
|
234
|
-
output
|
235
|
-
else
|
236
|
-
nil
|
237
|
-
end
|
238
|
-
end
|
239
|
-
|
240
|
-
# Post-process all writers and return an array of the results
|
241
|
-
#
|
242
|
-
# @param writers [Array<#write>] the writers to post-process
|
243
|
-
# @param normalize [Boolean] whether to normalize the output of each writer
|
244
|
-
# @param chomp [Boolean] whether to chomp the output of each writer
|
245
|
-
#
|
246
|
-
# @return [Array<String, nil>] the output of each writer that supports `#string`
|
247
|
-
#
|
248
|
-
# @api private
|
249
|
-
#
|
250
|
-
def post_process_all(writers, normalize, chomp)
|
251
|
-
Array.new.tap do |result|
|
252
|
-
writers.each { |writer| result << post_process(writer, normalize, chomp) }
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
# Raise an error when there was exception while collecting the subprocess output
|
257
|
-
#
|
258
|
-
# @param git_cmd [Array<String>] the git command that was executed
|
259
|
-
# @param pipe_name [Symbol] the name of the pipe that raised the exception
|
260
|
-
# @param pipe [ProcessExecuter::MonitoredPipe] the pipe that raised the exception
|
261
|
-
#
|
262
|
-
# @raise [Git::ProcessIOError]
|
263
|
-
#
|
264
|
-
# @return [void] this method always raises an error
|
265
|
-
#
|
266
|
-
# @api private
|
267
|
-
#
|
268
|
-
def raise_pipe_error(git_cmd, pipe_name, pipe)
|
269
|
-
raise Git::ProcessIOError.new("Pipe Exception for #{git_cmd}: #{pipe_name}"), cause: pipe.exception
|
270
|
-
end
|
271
|
-
|
272
|
-
# Execute the git command and collect the output
|
273
|
-
#
|
274
|
-
# @param cmd [Array<String>] the git command to execute
|
275
|
-
# @param chdir [String] the directory to run the command in
|
276
|
-
# @param timeout [Numeric, nil] the maximum seconds to wait for the command to complete
|
277
|
-
#
|
278
|
-
# If timeout is zero of nil, the command will not time out. If the command
|
279
|
-
# times out, it is killed via a SIGKILL signal and `Git::TimeoutError` is raised.
|
280
|
-
#
|
281
|
-
# If the command does not respond to SIGKILL, it will hang this method.
|
282
|
-
#
|
283
|
-
# @raise [Git::ProcessIOError] if an exception was raised while collecting subprocess output
|
284
|
-
# @raise [Git::TimeoutError] if the command times out
|
285
|
-
#
|
286
|
-
# @return [ProcessExecuter::Status] the status of the completed subprocess
|
287
|
-
#
|
288
|
-
# @api private
|
289
|
-
#
|
290
|
-
def spawn(cmd, out_writers, err_writers, chdir:, timeout:)
|
291
|
-
out_pipe = ProcessExecuter::MonitoredPipe.new(*out_writers, chunk_size: 10_000)
|
292
|
-
err_pipe = ProcessExecuter::MonitoredPipe.new(*err_writers, chunk_size: 10_000)
|
293
|
-
ProcessExecuter.spawn(env, *cmd, out: out_pipe, err: err_pipe, chdir: chdir, timeout: timeout)
|
294
|
-
ensure
|
295
|
-
out_pipe.close
|
296
|
-
err_pipe.close
|
297
|
-
raise_pipe_error(cmd, :stdout, out_pipe) if out_pipe.exception
|
298
|
-
raise_pipe_error(cmd, :stderr, err_pipe) if err_pipe.exception
|
299
|
-
end
|
300
|
-
|
301
|
-
# The writers that will be used to collect stdout and stderr
|
302
|
-
#
|
303
|
-
# Additional writers could be added here if you wanted to tee output
|
304
|
-
# or send output to the terminal.
|
305
|
-
#
|
306
|
-
# @param out [#write] the object to write stdout to
|
307
|
-
# @param err [#write] the object to write stderr to
|
308
|
-
#
|
309
|
-
# @return [Array<Array<#write>, Array<#write>>] the writers for stdout and stderr
|
310
|
-
#
|
311
|
-
# @api private
|
312
|
-
#
|
313
|
-
def writers(out, err)
|
314
|
-
out_writers = [out]
|
315
|
-
err_writers = [err]
|
316
|
-
[out_writers, err_writers]
|
317
|
-
end
|
318
|
-
|
319
214
|
# Process the result of the command and return a Git::CommandLineResult
|
320
215
|
#
|
321
216
|
# Post process output, log the command and result, and raise an error if the
|
322
217
|
# command failed.
|
323
218
|
#
|
324
|
-
# @param
|
325
|
-
# @param status [Process::Status] the status of the completed subprocess
|
326
|
-
# @param out [#write] the object that stdout was written to
|
327
|
-
# @param err [#write] the object that stderr was written to
|
219
|
+
# @param result [ProcessExecuter::Command::Result] the result it is a Process::Status and include command, stdout, and stderr
|
328
220
|
# @param normalize [Boolean] whether to normalize the output of each writer
|
329
221
|
# @param chomp [Boolean] whether to chomp the output of each writer
|
330
222
|
# @param timeout [Numeric, nil] the maximum seconds to wait for the command to complete
|
@@ -338,40 +230,58 @@ module Git
|
|
338
230
|
#
|
339
231
|
# @api private
|
340
232
|
#
|
341
|
-
def process_result(
|
342
|
-
|
343
|
-
|
344
|
-
logger.
|
345
|
-
|
346
|
-
|
347
|
-
raise Git::
|
348
|
-
raise Git::
|
233
|
+
def process_result(result, normalize, chomp, timeout)
|
234
|
+
command = result.command
|
235
|
+
processed_out, processed_err = post_process_all([result.stdout, result.stderr], normalize, chomp)
|
236
|
+
logger.info { "#{command} exited with status #{result}" }
|
237
|
+
logger.debug { "stdout:\n#{processed_out.inspect}\nstderr:\n#{processed_err.inspect}" }
|
238
|
+
Git::CommandLineResult.new(command, result, processed_out, processed_err).tap do |processed_result|
|
239
|
+
raise Git::TimeoutError.new(processed_result, timeout) if result.timeout?
|
240
|
+
raise Git::SignaledError.new(processed_result) if result.signaled?
|
241
|
+
raise Git::FailedError.new(processed_result) unless result.success?
|
349
242
|
end
|
350
243
|
end
|
351
244
|
|
352
|
-
#
|
245
|
+
# Post-process command output and return an array of the results
|
353
246
|
#
|
354
|
-
# @param
|
355
|
-
# @param
|
356
|
-
# @param
|
357
|
-
# @param chdir [String] the directory to run the command in
|
358
|
-
# @param timeout [Numeric, nil] the maximum seconds to wait for the command to complete
|
247
|
+
# @param raw_outputs [Array] the output to post-process
|
248
|
+
# @param normalize [Boolean] whether to normalize the output of each writer
|
249
|
+
# @param chomp [Boolean] whether to chomp the output of each writer
|
359
250
|
#
|
360
|
-
#
|
361
|
-
# times out, it is killed via a SIGKILL signal and `Git::TimeoutError` is raised.
|
251
|
+
# @return [Array<String, nil>] the processed output of each command output object that supports `#string`
|
362
252
|
#
|
363
|
-
#
|
253
|
+
# @api private
|
364
254
|
#
|
365
|
-
|
366
|
-
|
255
|
+
def post_process_all(raw_outputs, normalize, chomp)
|
256
|
+
Array.new.tap do |result|
|
257
|
+
raw_outputs.each { |raw_output| result << post_process(raw_output, normalize, chomp) }
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
# Determine the output to return in the `CommandLineResult`
|
367
262
|
#
|
368
|
-
#
|
263
|
+
# If the writer can return the output by calling `#string` (such as a StringIO),
|
264
|
+
# then return the result of normalizing the encoding and chomping the output
|
265
|
+
# as requested.
|
266
|
+
#
|
267
|
+
# If the writer does not support `#string`, then return nil. The output is
|
268
|
+
# assumed to be collected by the writer itself such as when the writer
|
269
|
+
# is a file instead of a StringIO.
|
270
|
+
#
|
271
|
+
# @param raw_output [#string] the output to post-process
|
272
|
+
# @return [String, nil]
|
369
273
|
#
|
370
274
|
# @api private
|
371
275
|
#
|
372
|
-
def
|
373
|
-
|
374
|
-
|
276
|
+
def post_process(raw_output, normalize, chomp)
|
277
|
+
if raw_output.respond_to?(:string)
|
278
|
+
output = raw_output.string.dup
|
279
|
+
output = output.lines.map { |l| Git::EncodingUtils.normalize_encoding(l) }.join if normalize
|
280
|
+
output.chomp! if chomp
|
281
|
+
output
|
282
|
+
else
|
283
|
+
nil
|
284
|
+
end
|
375
285
|
end
|
376
286
|
end
|
377
287
|
end
|
data/lib/git/config.rb
CHANGED
data/lib/git/diff.rb
CHANGED
data/lib/git/index.rb
CHANGED
data/lib/git/lib.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'git/command_line'
|
2
4
|
require 'git/errors'
|
3
5
|
require 'logger'
|
@@ -124,7 +126,7 @@ module Git
|
|
124
126
|
arr_opts = []
|
125
127
|
arr_opts << '--bare' if opts[:bare]
|
126
128
|
arr_opts << '--branch' << opts[:branch] if opts[:branch]
|
127
|
-
arr_opts << '--depth' << opts[:depth].to_i if opts[:depth]
|
129
|
+
arr_opts << '--depth' << opts[:depth].to_i if opts[:depth]
|
128
130
|
arr_opts << '--filter' << opts[:filter] if opts[:filter]
|
129
131
|
Array(opts[:config]).each { |c| arr_opts << '--config' << c }
|
130
132
|
arr_opts << '--origin' << opts[:remote] || opts[:origin] if opts[:remote] || opts[:origin]
|
@@ -292,6 +294,7 @@ module Git
|
|
292
294
|
# * 'tree' [String] the tree sha
|
293
295
|
# * 'author' [String] the author of the commit and timestamp of when the changes were created
|
294
296
|
# * 'committer' [String] the committer of the commit and timestamp of when the commit was applied
|
297
|
+
# * 'merges' [Boolean] if truthy, only include merge commits (aka commits with 2 or more parents)
|
295
298
|
#
|
296
299
|
# @raise [ArgumentError] if the revision range (specified with :between or :object) is a string starting with a hyphen
|
297
300
|
#
|
@@ -303,6 +306,7 @@ module Git
|
|
303
306
|
|
304
307
|
arr_opts << '--pretty=raw'
|
305
308
|
arr_opts << "--skip=#{opts[:skip]}" if opts[:skip]
|
309
|
+
arr_opts << '--merges' if opts[:merges]
|
306
310
|
|
307
311
|
arr_opts += log_path_options(opts)
|
308
312
|
|
@@ -331,7 +335,7 @@ module Git
|
|
331
335
|
def rev_parse(revision)
|
332
336
|
assert_args_are_not_options('rev', revision)
|
333
337
|
|
334
|
-
command('rev-parse', revision)
|
338
|
+
command('rev-parse', '--revs-only', '--end-of-options', revision, '--')
|
335
339
|
end
|
336
340
|
|
337
341
|
# For backwards compatibility with the old method name
|
@@ -570,7 +574,7 @@ module Git
|
|
570
574
|
case key
|
571
575
|
when 'commit'
|
572
576
|
hsh_array << hsh if hsh
|
573
|
-
hsh = {'sha' => value, 'message' => '', 'parent' => []}
|
577
|
+
hsh = {'sha' => value, 'message' => +'', 'parent' => []}
|
574
578
|
when 'parent'
|
575
579
|
hsh['parent'] << value
|
576
580
|
else
|
@@ -1545,7 +1549,8 @@ module Git
|
|
1545
1549
|
'GIT_DIR' => @git_dir,
|
1546
1550
|
'GIT_WORK_TREE' => @git_work_dir,
|
1547
1551
|
'GIT_INDEX_FILE' => @git_index_file,
|
1548
|
-
'GIT_SSH' => Git::Base.config.git_ssh
|
1552
|
+
'GIT_SSH' => Git::Base.config.git_ssh,
|
1553
|
+
'LC_ALL' => 'en_US.UTF-8'
|
1549
1554
|
}
|
1550
1555
|
end
|
1551
1556
|
|
data/lib/git/log.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Git
|
2
4
|
|
3
5
|
# Return the last n commits that match the specified criteria
|
@@ -131,11 +133,16 @@ module Git
|
|
131
133
|
return self
|
132
134
|
end
|
133
135
|
|
136
|
+
def merges
|
137
|
+
dirty_log
|
138
|
+
@merges = true
|
139
|
+
return self
|
140
|
+
end
|
141
|
+
|
134
142
|
def to_s
|
135
143
|
self.map { |c| c.to_s }.join("\n")
|
136
144
|
end
|
137
145
|
|
138
|
-
|
139
146
|
# forces git log to run
|
140
147
|
|
141
148
|
def size
|
@@ -182,7 +189,7 @@ module Git
|
|
182
189
|
log = @base.lib.full_log_commits(
|
183
190
|
count: @max_count, all: @all, object: @object, path_limiter: @path, since: @since,
|
184
191
|
author: @author, grep: @grep, skip: @skip, until: @until, between: @between,
|
185
|
-
cherry: @cherry
|
192
|
+
cherry: @cherry, merges: @merges
|
186
193
|
)
|
187
194
|
@commits = log.map { |c| Git::Object::Commit.new(@base, c['sha'], c) }
|
188
195
|
end
|
data/lib/git/object.rb
CHANGED
data/lib/git/path.rb
CHANGED
@@ -1,19 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Git
|
2
|
-
|
4
|
+
|
3
5
|
class Path
|
4
|
-
|
6
|
+
|
5
7
|
attr_accessor :path
|
6
|
-
|
8
|
+
|
7
9
|
def initialize(path, check_path=true)
|
8
10
|
path = File.expand_path(path)
|
9
|
-
|
11
|
+
|
10
12
|
if check_path && !File.exist?(path)
|
11
13
|
raise ArgumentError, 'path does not exist', [path]
|
12
14
|
end
|
13
|
-
|
15
|
+
|
14
16
|
@path = path
|
15
17
|
end
|
16
|
-
|
18
|
+
|
17
19
|
def readable?
|
18
20
|
File.readable?(@path)
|
19
21
|
end
|
@@ -21,11 +23,10 @@ module Git
|
|
21
23
|
def writable?
|
22
24
|
File.writable?(@path)
|
23
25
|
end
|
24
|
-
|
26
|
+
|
25
27
|
def to_s
|
26
28
|
@path
|
27
29
|
end
|
28
|
-
|
29
30
|
end
|
30
31
|
|
31
32
|
end
|
data/lib/git/remote.rb
CHANGED
data/lib/git/repository.rb
CHANGED
data/lib/git/stash.rb
CHANGED
@@ -1,27 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Git
|
2
4
|
class Stash
|
3
|
-
|
5
|
+
|
4
6
|
def initialize(base, message, existing=false)
|
5
7
|
@base = base
|
6
8
|
@message = message
|
7
9
|
save unless existing
|
8
10
|
end
|
9
|
-
|
11
|
+
|
10
12
|
def save
|
11
13
|
@saved = @base.lib.stash_save(@message)
|
12
14
|
end
|
13
|
-
|
15
|
+
|
14
16
|
def saved?
|
15
17
|
@saved
|
16
18
|
end
|
17
|
-
|
19
|
+
|
18
20
|
def message
|
19
21
|
@message
|
20
22
|
end
|
21
|
-
|
23
|
+
|
22
24
|
def to_s
|
23
25
|
message
|
24
26
|
end
|
25
|
-
|
26
27
|
end
|
27
28
|
end
|
data/lib/git/stashes.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Git
|
2
|
-
|
4
|
+
|
3
5
|
# object that holds all the available stashes
|
4
6
|
class Stashes
|
5
7
|
include Enumerable
|
6
|
-
|
8
|
+
|
7
9
|
def initialize(base)
|
8
10
|
@stashes = []
|
9
|
-
|
11
|
+
|
10
12
|
@base = base
|
11
|
-
|
13
|
+
|
12
14
|
@base.lib.stashes_all.each do |id, message|
|
13
15
|
@stashes.unshift(Git::Stash.new(@base, message, true))
|
14
16
|
end
|
@@ -24,16 +26,16 @@ module Git
|
|
24
26
|
def all
|
25
27
|
@base.lib.stashes_all
|
26
28
|
end
|
27
|
-
|
29
|
+
|
28
30
|
def save(message)
|
29
31
|
s = Git::Stash.new(@base, message)
|
30
32
|
@stashes.unshift(s) if s.saved?
|
31
33
|
end
|
32
|
-
|
34
|
+
|
33
35
|
def apply(index=nil)
|
34
36
|
@base.lib.stash_apply(index)
|
35
37
|
end
|
36
|
-
|
38
|
+
|
37
39
|
def clear
|
38
40
|
@base.lib.stash_clear
|
39
41
|
@stashes = []
|
@@ -42,14 +44,13 @@ module Git
|
|
42
44
|
def size
|
43
45
|
@stashes.size
|
44
46
|
end
|
45
|
-
|
47
|
+
|
46
48
|
def each(&block)
|
47
49
|
@stashes.each(&block)
|
48
50
|
end
|
49
|
-
|
51
|
+
|
50
52
|
def [](index)
|
51
53
|
@stashes[index.to_i]
|
52
54
|
end
|
53
|
-
|
54
55
|
end
|
55
56
|
end
|
data/lib/git/status.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Git
|
2
4
|
# The status class gets the status of a git repository
|
3
5
|
#
|
@@ -100,7 +102,7 @@ module Git
|
|
100
102
|
end
|
101
103
|
|
102
104
|
def pretty
|
103
|
-
out = ''
|
105
|
+
out = +''
|
104
106
|
each do |file|
|
105
107
|
out << pretty_file(file)
|
106
108
|
end
|
data/lib/git/version.rb
CHANGED
data/lib/git/worktree.rb
CHANGED
data/lib/git/worktrees.rb
CHANGED
data/lib/git.rb
CHANGED
data/package.json
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"bootstrap-sha": "31374263eafea4e23352494ef4f6bea3ce62c1b5",
|
3
|
+
"packages": {
|
4
|
+
".": {
|
5
|
+
"release-type": "ruby",
|
6
|
+
"package-name": "git",
|
7
|
+
"changelog-path": "CHANGELOG.md",
|
8
|
+
"version-file": "lib/git/version.rb",
|
9
|
+
"bump-minor-pre-major": true,
|
10
|
+
"bump-patch-for-minor-pre-major": true,
|
11
|
+
"draft": false,
|
12
|
+
"prerelease": false,
|
13
|
+
"include-component-in-tag": false,
|
14
|
+
"pull-request-title-pattern": "chore: release v${version}",
|
15
|
+
"changelog-sections": [
|
16
|
+
{ "type": "feat", "section": "Features", "hidden": false },
|
17
|
+
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
|
18
|
+
{ "type": "build", "section": "Other Changes", "hidden": false },
|
19
|
+
{ "type": "chore", "section": "Other Changes", "hidden": false },
|
20
|
+
{ "type": "ci", "section": "Other Changes", "hidden": false },
|
21
|
+
{ "type": "docs", "section": "Other Changes", "hidden": false },
|
22
|
+
{ "type": "perf", "section": "Other Changes", "hidden": false },
|
23
|
+
{ "type": "refactor", "section": "Other Changes", "hidden": false },
|
24
|
+
{ "type": "revert", "section": "Other Changes", "hidden": false },
|
25
|
+
{ "type": "style", "section": "Other Changes", "hidden": false },
|
26
|
+
{ "type": "test", "section": "Other Changes", "hidden": false }
|
27
|
+
]
|
28
|
+
}
|
29
|
+
},
|
30
|
+
"plugins": [
|
31
|
+
{
|
32
|
+
"type": "sentence-case"
|
33
|
+
}
|
34
|
+
],
|
35
|
+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
|
36
|
+
}
|