Skip to content

Commit

Permalink
Ignore changed files under removed paths
Browse files Browse the repository at this point in the history
This fixes the issue commit 43ab2ac
"Resurrect gem-specific patterns for sync" described.
  • Loading branch information
nobu committed Sep 16, 2023
1 parent 9aeb6e7 commit 67dedf8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tool/sync_default_gems.rb
Expand Up @@ -447,15 +447,7 @@ def ignore_file_pattern_for(gem)

# Gem-specific patterns
case gem
when "yarp"
%r[\A(?:
Makefile\.in
|configure\.ac
|fuzz/.*
|rust/.*
|tasks/.*
|ext/yarp/extconf\.rb
)\z]mx
when nil
end&.tap do |pattern|
patterns << pattern
end
Expand Down Expand Up @@ -606,6 +598,8 @@ def pickup_files(gem, changed, picked)
if picked
system(*%w"git commit --amend --no-edit --", *remove, %i[out err] => File::NULL)
end
remove = remove.map {|d| d + "/"}
changed.delete_if {|f| remove.any? {|d| f.start_with?(d)}}
end

unless ignore.empty?
Expand Down

0 comments on commit 67dedf8

Please sign in to comment.