Ignore changed files under removed paths

This fixes the issue commit 43ab2acf8242c580b1ef5d644ea94d48669d4869
"Resurrect gem-specific patterns for sync" described.
This commit is contained in:
Nobuyoshi Nakada 2023-09-16 11:56:50 +09:00
parent 9aeb6e72db
commit 67dedf8cf6
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

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