Method: Mailmap::Map#lookup

Defined in:
lib/mailmap/map.rb

#lookup(commit_name_or_nil, commit_email) ⇒ (String, String), ...

Look up the person’s canonical name and email address. If found, return them; otherwise return nil.

Parameters:

  • commit_name_or_nil (String, nil)

    the name in commit or nil

  • commit_email (String)

    the name in commit

Returns:

  • ((String, String))

    if found, a pair of proper name and email

  • ((String, nil))

    if only proper name is found

  • ((nil, String))

    if only proper email is found

  • (nil)

    if not found

[View source]

53
54
55
56
57
58
# File 'lib/mailmap/map.rb', line 53

def lookup(commit_name_or_nil, commit_email)
  commit_name = commit_name_or_nil&.downcase
  commit_email = commit_email.downcase
  hash = @map[commit_email]
  hash[commit_name] || hash[nil]
end