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
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
@ -606,6 +598,8 @@ module SyncDefaultGems
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?