A hash for the git gem based on the git repository URI.
# File lib/rubygems/source/git.rb, line 227
def uri_hash # :nodoc:
require 'digest' # required here to avoid deadlocking in Gem.activate_bin_path (because digest is a gem on 2.5+)
normalized =
if @repository =~ %^\w+://(\w+@)?% then
uri = URI(@repository).normalize.to_s.sub %/$%,''
uri.sub(/\A(\w+)/) { $1.downcase }
else
@repository
end
Digest::SHA1.hexdigest normalized
end