rfix 2.0.4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/rfix +11 -90
- data/lib/rfix.rb +10 -9
- data/lib/rfix/branch/reference.rb +2 -2
- data/lib/rfix/branch/upstream.rb +2 -4
- data/lib/rfix/cli/command.rb +14 -1
- data/lib/rfix/cli/command/all.rb +21 -0
- data/lib/rfix/cli/command/base.rb +30 -19
- data/lib/rfix/cli/command/branch.rb +2 -0
- data/lib/rfix/cli/command/help.rb +2 -0
- data/lib/rfix/cli/command/info.rb +6 -1
- data/lib/rfix/cli/command/local.rb +2 -0
- data/lib/rfix/cli/command/origin.rb +2 -0
- data/lib/rfix/cli/command/setup.rb +2 -0
- data/lib/rfix/cli/command/status.rb +39 -0
- data/lib/rfix/collector.rb +69 -0
- data/lib/rfix/diff.rb +69 -0
- data/lib/rfix/extension/comment_config.rb +15 -0
- data/lib/rfix/extension/offense.rb +17 -14
- data/lib/rfix/extension/pastel.rb +7 -4
- data/lib/rfix/extension/progresbar.rb +15 -0
- data/lib/rfix/extension/strings.rb +10 -2
- data/lib/rfix/file.rb +5 -3
- data/lib/rfix/file/base.rb +21 -14
- data/lib/rfix/file/deleted.rb +2 -0
- data/lib/rfix/file/ignored.rb +2 -0
- data/lib/rfix/file/null.rb +17 -0
- data/lib/rfix/file/tracked.rb +39 -23
- data/lib/rfix/file/undefined.rb +17 -0
- data/lib/rfix/file/untracked.rb +3 -1
- data/lib/rfix/formatter.rb +67 -71
- data/lib/rfix/highlighter.rb +1 -3
- data/lib/rfix/rake/gemfile.rb +26 -23
- data/lib/rfix/repository.rb +59 -96
- data/lib/rfix/types.rb +24 -14
- data/lib/rfix/version.rb +1 -1
- data/rfix.gemspec +11 -3
- data/vendor/cli-ui/Gemfile +17 -0
- data/vendor/cli-ui/Gemfile.lock +60 -0
- data/vendor/cli-ui/LICENSE.txt +21 -0
- data/vendor/cli-ui/README.md +224 -0
- data/vendor/cli-ui/Rakefile +20 -0
- data/vendor/cli-ui/bin/console +14 -0
- data/vendor/cli-ui/cli-ui.gemspec +25 -0
- data/vendor/cli-ui/dev.yml +14 -0
- data/vendor/cli-ui/lib/cli/ui.rb +233 -0
- data/vendor/cli-ui/lib/cli/ui/ansi.rb +157 -0
- data/vendor/cli-ui/lib/cli/ui/color.rb +84 -0
- data/vendor/cli-ui/lib/cli/ui/formatter.rb +192 -0
- data/vendor/cli-ui/lib/cli/ui/frame.rb +269 -0
- data/vendor/cli-ui/lib/cli/ui/frame/frame_stack.rb +98 -0
- data/vendor/cli-ui/lib/cli/ui/frame/frame_style.rb +120 -0
- data/vendor/cli-ui/lib/cli/ui/frame/frame_style/box.rb +166 -0
- data/vendor/cli-ui/lib/cli/ui/frame/frame_style/bracket.rb +139 -0
- data/vendor/cli-ui/lib/cli/ui/glyph.rb +84 -0
- data/vendor/cli-ui/lib/cli/ui/os.rb +67 -0
- data/vendor/cli-ui/lib/cli/ui/printer.rb +59 -0
- data/vendor/cli-ui/lib/cli/ui/progress.rb +90 -0
- data/vendor/cli-ui/lib/cli/ui/prompt.rb +297 -0
- data/vendor/cli-ui/lib/cli/ui/prompt/interactive_options.rb +484 -0
- data/vendor/cli-ui/lib/cli/ui/prompt/options_handler.rb +29 -0
- data/vendor/cli-ui/lib/cli/ui/spinner.rb +66 -0
- data/vendor/cli-ui/lib/cli/ui/spinner/async.rb +40 -0
- data/vendor/cli-ui/lib/cli/ui/spinner/spin_group.rb +263 -0
- data/vendor/cli-ui/lib/cli/ui/stdout_router.rb +232 -0
- data/vendor/cli-ui/lib/cli/ui/terminal.rb +46 -0
- data/vendor/cli-ui/lib/cli/ui/truncater.rb +102 -0
- data/vendor/cli-ui/lib/cli/ui/version.rb +5 -0
- data/vendor/cli-ui/lib/cli/ui/widgets.rb +77 -0
- data/vendor/cli-ui/lib/cli/ui/widgets/base.rb +27 -0
- data/vendor/cli-ui/lib/cli/ui/widgets/status.rb +61 -0
- data/vendor/cli-ui/lib/cli/ui/wrap.rb +56 -0
- data/vendor/cli-ui/test/cli/ui/ansi_test.rb +32 -0
- data/vendor/cli-ui/test/cli/ui/cli_ui_test.rb +23 -0
- data/vendor/cli-ui/test/cli/ui/color_test.rb +40 -0
- data/vendor/cli-ui/test/cli/ui/formatter_test.rb +79 -0
- data/vendor/cli-ui/test/cli/ui/glyph_test.rb +68 -0
- data/vendor/cli-ui/test/cli/ui/printer_test.rb +103 -0
- data/vendor/cli-ui/test/cli/ui/progress_test.rb +46 -0
- data/vendor/cli-ui/test/cli/ui/prompt/options_handler_test.rb +39 -0
- data/vendor/cli-ui/test/cli/ui/prompt_test.rb +348 -0
- data/vendor/cli-ui/test/cli/ui/spinner/spin_group_test.rb +39 -0
- data/vendor/cli-ui/test/cli/ui/spinner_test.rb +141 -0
- data/vendor/cli-ui/test/cli/ui/stdout_router_test.rb +32 -0
- data/vendor/cli-ui/test/cli/ui/terminal_test.rb +26 -0
- data/vendor/cli-ui/test/cli/ui/truncater_test.rb +31 -0
- data/vendor/cli-ui/test/cli/ui/widgets/status_test.rb +49 -0
- data/vendor/cli-ui/test/cli/ui/widgets_test.rb +15 -0
- data/vendor/cli-ui/test/test_helper.rb +53 -0
- data/vendor/cli-ui/tmp/cache/bootsnap/compile-cache/d9/c036af0f3dc494 +0 -0
- data/vendor/cli-ui/tmp/cache/bootsnap/load-path-cache +0 -0
- data/vendor/dry-cli/lib/dry/cli/command.rb +2 -1
- data/vendor/dry-cli/tmp/cache/bootsnap/compile-cache/ff/a22a5daafbd74c +0 -0
- data/vendor/dry-cli/tmp/cache/bootsnap/load-path-cache +0 -0
- data/vendor/strings-ansi/tmp/cache/bootsnap/compile-cache/79/49cf49407b370e +0 -0
- data/vendor/strings-ansi/tmp/cache/bootsnap/load-path-cache +0 -0
- metadata +170 -9
- data/lib/rfix/extension/string.rb +0 -12
- data/lib/rfix/indicator.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a7fa6803ed26d756483ddbebd07a92bb34f485112ea984754eda6ff8af4e18e
|
4
|
+
data.tar.gz: bf4954a1f5b938c826ed21390e25f22f6bb3095fd803149c9c977339e24ecd97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05031f0a115d547614fe9bd3b675c3aba36e1713230b363f67faf726b5971707b4165788b83b3aa911a0bda38faf865bc155ac9c9f553ffe5815ad2dea54defc
|
7
|
+
data.tar.gz: ae3b638be3c3423fe57abf01c5665870ec83f9e7fddbac7ec46ea2a5a2cb4c00973983e1f51871c4c2da7aa4ecda9e450141a9a4427687fad1252ca7ecdba317
|
data/exe/rfix
CHANGED
@@ -1,95 +1,16 @@
|
|
1
|
-
#!/usr/bin/env -S ruby -W0 --disable-all
|
1
|
+
#!/usr/bin/env -S ruby -W0 --disable-all --enable=gems
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
require "pathname"
|
6
|
-
require "bundler"
|
4
|
+
require_relative "../lib/rfix"
|
7
5
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
LOCK = "Gemfile.lock"
|
12
|
-
PWD = Pathname.getwd
|
13
|
-
PROJECT = DIR.join("..").expand_path
|
14
|
-
end
|
15
|
-
|
16
|
-
def lock_path
|
17
|
-
Path::PWD.ascend.find do |path|
|
18
|
-
return if (path <=> Path::HOME) == -1
|
19
|
-
|
20
|
-
path.join(Path::LOCK).file?
|
21
|
-
end.join(Path::LOCK)
|
22
|
-
end
|
23
|
-
|
24
|
-
def find(name, env: Bundler.rubygems)
|
25
|
-
env.loaded_specs(name) || env.find_name(name).max_by(&:version)
|
26
|
-
end
|
27
|
-
|
28
|
-
def deactivate(spec)
|
29
|
-
Gem.loaded_specs.delete(spec.name)
|
30
|
-
|
31
|
-
$LOAD_PATH.reject! do |path|
|
32
|
-
spec.load_paths.include?(path)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def specs
|
37
|
-
return [] unless (path = lock_path)
|
38
|
-
|
39
|
-
Bundler::LockfileParser.new(path.read).specs
|
40
|
-
end
|
41
|
-
|
42
|
-
def overlapping_specs
|
43
|
-
specs.select do |spec|
|
44
|
-
spec.name.start_with?("rubocop")
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def rfix
|
49
|
-
find("rfix")
|
50
|
-
end
|
51
|
-
|
52
|
-
def dev?
|
53
|
-
# $PROGRAM_NAME.end_with?("exe/rfix")
|
54
|
-
false
|
55
|
-
end
|
56
|
-
|
57
|
-
def rfix_path
|
58
|
-
return Pathname(__dir__).parent if dev?
|
59
|
-
|
60
|
-
Pathname(rfix.full_gem_path)
|
61
|
-
end
|
62
|
-
|
63
|
-
def commands
|
64
|
-
rfix_path.glob("lib/rfix/commands/*.rb").map do |command|
|
65
|
-
Cri::Command.load_file(command.to_path, infer_name: true)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def deactivate_all!
|
70
|
-
Gem.loaded_specs.each do |_name, spec|
|
71
|
-
deactivate(spec)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
deactivate_all!
|
76
|
-
|
77
|
-
require "bundler/inline"
|
78
|
-
gemfile(false, ui: Bundler::UI::Silent.new) do
|
79
|
-
overlapping_specs.each do |spec|
|
80
|
-
gem spec.name, spec.version
|
81
|
-
end
|
82
|
-
|
83
|
-
path rfix_path do
|
84
|
-
gem "rfix"
|
85
|
-
end
|
86
|
-
|
87
|
-
path rfix_path.join("vendor") do
|
88
|
-
gem "dry-cli", require: "dry/cli"
|
89
|
-
gem "strings-ansi"
|
90
|
-
end
|
91
|
-
end
|
6
|
+
require "rubocop"
|
7
|
+
require "dry/cli"
|
8
|
+
require "rainbow"
|
92
9
|
|
93
|
-
|
94
|
-
|
10
|
+
begin
|
11
|
+
exit Rfix::CLI::Command.setup
|
12
|
+
rescue Errno::ENOENT, RuboCop::Error => e
|
13
|
+
abort [Rainbow("\n==>").red, e.message].join(" ")
|
14
|
+
rescue Interrupt
|
15
|
+
exit 1
|
95
16
|
end
|
data/lib/rfix.rb
CHANGED
@@ -1,22 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
$LOAD_PATH.push Pathname(__dir__).join("../vendor/strings-ansi/lib")
|
4
|
-
$LOAD_PATH.push Pathname(__dir__).join("../vendor/dry-cli/lib")
|
5
|
-
|
6
3
|
require "active_support/core_ext/module/attribute_accessors"
|
7
|
-
require "
|
4
|
+
require "active_support/core_ext/module/concerning"
|
8
5
|
require "zeitwerk"
|
9
|
-
require "rubocop"
|
10
6
|
|
11
7
|
loader = Zeitwerk::Loader.for_gem
|
12
|
-
|
8
|
+
|
13
9
|
loader.ignore("#{__dir__}/rfix/rake/support")
|
14
|
-
loader.ignore("#{__dir__}/rfix/
|
10
|
+
loader.ignore("#{__dir__}/rfix/rake/paths")
|
11
|
+
loader.ignore("#{__dir__}/rfix/extension")
|
15
12
|
loader.ignore("#{__dir__}/rfix/commands")
|
16
|
-
loader.ignore("#{__dir__}/rfix/
|
17
|
-
|
13
|
+
loader.ignore("#{__dir__}/rfix/rake")
|
14
|
+
|
18
15
|
loader.inflector.inflect "cli" => "CLI"
|
19
16
|
|
17
|
+
loader.on_load("Rfix::Formatter") do
|
18
|
+
Pathname(__dir__).glob("rfix/extension/*", &method(:require))
|
19
|
+
end
|
20
|
+
|
20
21
|
loader.setup
|
21
22
|
|
22
23
|
module Rfix
|
@@ -7,8 +7,8 @@ module Rfix
|
|
7
7
|
|
8
8
|
def resolve
|
9
9
|
repository.lookup(repository.rev_parse(name).oid)
|
10
|
-
rescue Rugged::Error, Rugged::InvalidError
|
11
|
-
raise Error, name
|
10
|
+
rescue Rugged::Error, Rugged::InvalidError, Rugged::ReferenceError
|
11
|
+
raise Error, "Reference #{name.inspect} not found"
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/rfix/branch/upstream.rb
CHANGED
data/lib/rfix/cli/command.rb
CHANGED
@@ -13,7 +13,20 @@ module Rfix
|
|
13
13
|
register "setup", Setup
|
14
14
|
register "lint", Lint
|
15
15
|
register "info", Info
|
16
|
-
register "
|
16
|
+
register "all", All
|
17
|
+
register "status", Status
|
18
|
+
|
19
|
+
# register "help", Help
|
20
|
+
|
21
|
+
def setup
|
22
|
+
Dry::CLI.new(self).call
|
23
|
+
rescue Error => e
|
24
|
+
abort e.message
|
25
|
+
else
|
26
|
+
exit 0
|
27
|
+
end
|
28
|
+
|
29
|
+
module_function :setup
|
17
30
|
end
|
18
31
|
end
|
19
32
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rfix
|
4
|
+
module CLI
|
5
|
+
module Command
|
6
|
+
class All < Base
|
7
|
+
def call(**params)
|
8
|
+
walker = Rugged::Walker.new(Rugged::Repository.discover)
|
9
|
+
walker.sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE)
|
10
|
+
walker.push("HEAD")
|
11
|
+
|
12
|
+
unless oid = walker.each_oid(limit: 1).first
|
13
|
+
raise Error, "Repository contains no commits"
|
14
|
+
end
|
15
|
+
|
16
|
+
define(Rfix::Branch::Reference.new(name: oid), **params)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -6,9 +6,6 @@ require "rubocop"
|
|
6
6
|
require "rainbow"
|
7
7
|
require "rugged"
|
8
8
|
|
9
|
-
require "rfix/extension/pastel"
|
10
|
-
require "rfix/extension/strings"
|
11
|
-
|
12
9
|
module Rfix
|
13
10
|
module CLI
|
14
11
|
module Command
|
@@ -16,29 +13,22 @@ module Rfix
|
|
16
13
|
include Log
|
17
14
|
include Dry::Core::Constants
|
18
15
|
|
19
|
-
class RuboCop::CommentConfig
|
20
|
-
concerning :Verification, prepend: true do
|
21
|
-
def cop_enabled_at_line?(_, line)
|
22
|
-
repository.include?(processed_source.file_path, line)
|
23
|
-
rescue StandardError => e
|
24
|
-
abort e.full_message(highlight: true)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
16
|
option :formatters, type: :array, default: ["Rfix::Formatter"]
|
30
17
|
option :format, type: :string, default: "Rfix::Formatter"
|
31
18
|
option :auto_correct_all, type: :boolean, default: true
|
32
19
|
option :auto_correct, type: :boolean, default: true
|
20
|
+
option :parallel, type: :boolean, default: false
|
33
21
|
option :cache, type: :boolean, default: true
|
34
22
|
option :debug, type: :boolean, default: false
|
35
23
|
option :only_recognized_file_types, type: :boolean, default: true
|
24
|
+
option :no_cache, type: :boolean, default: false
|
36
25
|
option :force_exclusion, type: :boolean, default: true
|
37
26
|
|
38
27
|
private
|
39
28
|
|
40
29
|
def define(reference, args: Undefined, **params)
|
41
30
|
handler = Rfix::Repository.new(
|
31
|
+
current_path: Pathname.pwd.relative_path_from(reference.repository.workdir),
|
42
32
|
repository: reference.repository,
|
43
33
|
reference: reference
|
44
34
|
)
|
@@ -49,15 +39,36 @@ module Rfix
|
|
49
39
|
end
|
50
40
|
end
|
51
41
|
|
52
|
-
|
53
|
-
|
42
|
+
paths = handler.paths
|
43
|
+
|
44
|
+
variadic_args = Undefined.default(args, EMPTY_ARRAY)
|
45
|
+
RuboCop::Options.new.parse(variadic_args).then do |user_defined_options, user_defined_paths|
|
46
|
+
params.merge!(user_defined_options)
|
47
|
+
|
48
|
+
unless user_defined_paths.empty?
|
49
|
+
paths.replace(user_defined_paths)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
config = RuboCop::ConfigStore.new.tap do |config_store|
|
54
|
+
RuboCop::ConfigLoader.configuration_file_for(handler.workdir).then do |loader|
|
55
|
+
config_store.options_config = loader
|
56
|
+
rescue RuboCop::Cop::AmbiguousCopName => e
|
57
|
+
abort e.message
|
58
|
+
end
|
54
59
|
end
|
55
60
|
|
56
|
-
|
57
|
-
RuboCop::
|
58
|
-
|
59
|
-
|
61
|
+
if params[:no_cache]
|
62
|
+
RuboCop::ResultCache.cleanup(config, true)
|
63
|
+
XDG::Config.new.home.then do |cache_path|
|
64
|
+
cache_path.rmtree if cache_path.exist?
|
65
|
+
end
|
60
66
|
end
|
67
|
+
|
68
|
+
params.merge!(repository: handler)
|
69
|
+
|
70
|
+
env = RuboCop::CLI::Environment.new(params, config, paths)
|
71
|
+
RuboCop::CLI::Command::ExecuteRunner.new(env).run
|
61
72
|
end
|
62
73
|
end
|
63
74
|
end
|
@@ -1,9 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rubocop"
|
4
|
+
|
1
5
|
module Rfix
|
2
6
|
module CLI
|
3
7
|
module Command
|
4
8
|
class Info < Base
|
5
9
|
def call(**)
|
6
|
-
|
10
|
+
puts "Rubocop: #{RuboCop::Version.version}"
|
11
|
+
puts "Rfix: #{VERSION}"
|
7
12
|
end
|
8
13
|
end
|
9
14
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/all"
|
4
|
+
require "tty/tree"
|
5
|
+
require "pry"
|
6
|
+
|
7
|
+
module Rfix
|
8
|
+
module CLI
|
9
|
+
module Command
|
10
|
+
class Status < Base
|
11
|
+
def call(**_params)
|
12
|
+
walker = Rugged::Walker.new(Rugged::Repository.discover)
|
13
|
+
walker.sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE)
|
14
|
+
walker.push("HEAD")
|
15
|
+
|
16
|
+
unless oid = walker.each_oid(limit: 1).first
|
17
|
+
raise Error, "Repository contains no commits"
|
18
|
+
end
|
19
|
+
|
20
|
+
ref = Rfix::Branch::Reference.new(name: oid)
|
21
|
+
repo = Repository.new(repository: Rugged::Repository.discover, reference: ref)
|
22
|
+
files = repo.permitted
|
23
|
+
|
24
|
+
pp files.map(&:status).uniq
|
25
|
+
|
26
|
+
result = files.map do |file|
|
27
|
+
file.to_s.split("/").reverse.reduce({}) do |acc, part|
|
28
|
+
next { "#{part} (#{file.class}:#{file.status.join(', ')})" => {} } if acc.empty?
|
29
|
+
|
30
|
+
{ part.to_s => acc }
|
31
|
+
end
|
32
|
+
end.reduce(EMPTY_HASH, :deep_merge)
|
33
|
+
|
34
|
+
puts TTY::Tree.new({ root: result }).render
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "dry/struct"
|
4
|
+
|
5
|
+
module Rfix
|
6
|
+
class Collector < Dry::Struct
|
7
|
+
# https://github.com/libgit2/rugged/blob/master/lib/rugged/tree.rb
|
8
|
+
OPTIONS = {
|
9
|
+
include_untracked_content: true,
|
10
|
+
ignore_whitespace_change: false,
|
11
|
+
recurse_untracked_dirs: true,
|
12
|
+
ignore_whitespace_eol: false,
|
13
|
+
disable_pathspec_match: true,
|
14
|
+
include_unmodified: true,
|
15
|
+
include_untracked: true,
|
16
|
+
ignore_submodules: true,
|
17
|
+
include_ignored: false,
|
18
|
+
deltas_are_icase: true,
|
19
|
+
ignore_filemode: true,
|
20
|
+
force_text: true,
|
21
|
+
context_lines: 0
|
22
|
+
}.freeze
|
23
|
+
|
24
|
+
attribute :repository, Repository
|
25
|
+
attribute :reference, Types::String
|
26
|
+
|
27
|
+
delegate_missing_to :repository
|
28
|
+
|
29
|
+
include Enumerable
|
30
|
+
|
31
|
+
def each(&block)
|
32
|
+
construct = lambda do |path, statuses|
|
33
|
+
File.call(basename: path, status: statuses, repository: repository)
|
34
|
+
end
|
35
|
+
|
36
|
+
statuses = Hash.new(EMPTY_ARRAY).tap do |statuses|
|
37
|
+
repository.status do |path, status|
|
38
|
+
statuses[path] = status
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
if repository.head_unborn?
|
43
|
+
statuses.each do |path, status|
|
44
|
+
(block << construct).call(path, status)
|
45
|
+
end
|
46
|
+
else
|
47
|
+
origin.diff_workdir(**OPTIONS.dup).tap do |diff|
|
48
|
+
diff.find_similar!(
|
49
|
+
renames_from_rewrites: true,
|
50
|
+
renames: true,
|
51
|
+
copies: true
|
52
|
+
)
|
53
|
+
end.each_delta do |delta|
|
54
|
+
delta.new_file.fetch(:path).then do |file_path|
|
55
|
+
(block << construct).call(file_path, statuses[file_path] + [delta.status])
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def origin
|
64
|
+
repository.lookup(repository.rev_parse(reference).oid)
|
65
|
+
rescue Rugged::Error, Rugged::InvalidError, Rugged::ReferenceError
|
66
|
+
raise Error, "Reference #{reference.inspect} not found"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|