class Bundler::Source::Git

def uri_hash

def uri_hash
  if uri =~ %r{^\w+://(\w+@)?}
    # Downcase the domain component of the URI
    # and strip off a trailing slash, if one is present
    input = URI.parse(uri).normalize.to_s.sub(%r{/$},'')
  else
    # If there is no URI scheme, assume it is an ssh/git URI
    input = uri
  end
  Digest::SHA1.hexdigest(input)
end