Move special patterns to the common pattern

This commit is contained in:
Nobuyoshi Nakada 2023-09-17 21:11:54 +09:00
parent bcb3247072
commit 2dffd36504
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -434,15 +434,12 @@ module SyncDefaultGems
# Common patterns # Common patterns
patterns << %r[\A(?: patterns << %r[\A(?:
[A-Z]\w*\.(?:md|txt) [^/]+ # top-level entries
|[^/]+\.yml
|\.git.* |\.git.*
|[A-Z]\w+file
|COPYING
|Gemfile.lock
|bin/.* |bin/.*
|rakelib/.* |rakelib/.*
|test/lib/.* |test/(?:lib|fixtures)/.*
|tool/.*
)\z]mx )\z]mx
# Gem-specific patterns # Gem-specific patterns
@ -570,11 +567,6 @@ module SyncDefaultGems
} }
# Remove any new top-level directories. # Remove any new top-level directories.
true true
when !f.include?("/"),
f.start_with?("test/fixtures/", "test/lib/", "tool/")
# Forcibly reset any top-level entries, and any changes under
# /test/fixtures, /test/lib, or /tool.
ignore << f
when ignore_file_pattern.match?(f) when ignore_file_pattern.match?(f)
# Forcibly reset any changes matching ignore_file_pattern. # Forcibly reset any changes matching ignore_file_pattern.
ignore << f ignore << f