Method: Mailmap::Map#resolve

Defined in:
lib/mailmap/map.rb

#resolve(commit_name_or_nil, commit_email) ⇒ (String, String), (nil, String)

Like git-check-mailmap command, look up the person’s canonical name and email address. If found, return them; otherwise return the input as-is.

Parameters:

  • commit_name_or_nil (String, nil)

    the name in commit or nil

  • commit_email (String)

    the email in commit

Returns:

  • ((String, String))

    a pair of proper name and email

  • ((nil, String))

    if proper name is not found and commit_name is not provided

[View source]

67
68
69
70
71
72
# File 'lib/mailmap/map.rb', line 67

def resolve(commit_name_or_nil, commit_email)
  proper_name, proper_email = lookup(commit_name_or_nil, commit_email)
  proper_name ||= commit_name_or_nil
  proper_email ||= commit_email
  [proper_name, proper_email]
end