This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 5e3d4c12 Ensure we don't pick up a cached entry here
5e3d4c12 is described below
commit 5e3d4c12315d5f95fee2b02e10561f5daafd151f
Author: Sebb <[email protected]>
AuthorDate: Sat Mar 2 17:28:47 2024 +0000
Ensure we don't pick up a cached entry here
---
lib/whimsy/asf/committee.rb | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/whimsy/asf/committee.rb b/lib/whimsy/asf/committee.rb
index 2d54ebeb..a2402194 100644
--- a/lib/whimsy/asf/committee.rb
+++ b/lib/whimsy/asf/committee.rb
@@ -464,7 +464,7 @@ module ASF
# List uses full (display) names as keys, but the entries use the
canonical names
# - the local version of find() converts the name
# - and stores the original as the display name if it has some upper case
- list = Hash.new {|hash, name| hash[name] = find(name)}
+ list = Hash.new {|hash, name| hash[name] = find(name, true)}
# Split the file on lines starting "* ", i.e. the start of each group in
section 3
info = contents.split(/^\* /)
@@ -603,9 +603,12 @@ module ASF
# Finds a committee based on the name of the Committee. Is aware of
# a number of aliases for a given committee. Will set display name
# if the name being searched on contains an uppercase character.
- def self.find(name)
+ # If clear is true, then remove any cached entry
+ def self.find(name, clear=false)
raise ArgumentError.new('name: must not be nil') unless name
- result = super(@@namemap.call(name.downcase))
+ namelc = @@namemap.call(name.downcase)
+ collection[namelc] = nil if clear
+ result = super(namelc)
result.display_name = name if name =~ /[A-Z]/
result
end