summaryrefslogtreecommitdiff
path: root/lib/bundler/source/git.rb
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2021-10-18 10:12:39 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-10-25 20:24:32 +0900
commit5af3f7f3574c16ec76fb44b21beec17a74f4417a (patch)
tree74466c2e744de33d146930dc711d37ab1853ecb0 /lib/bundler/source/git.rb
parent86e3d77abb8a033650937710d1ab009e98647494 (diff)
[rubygems/rubygems] Vendor a pure ruby implementation of SHA1
This allows `Source::Git` to no longer load the `digest` gem as it is causing issues on Ruby 3.1. https://github.com/rubygems/rubygems/pull/4989/commits/c19a9f2ff7
Diffstat (limited to 'lib/bundler/source/git.rb')
-rw-r--r--lib/bundler/source/git.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 679fb22574..a41a2f23e9 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -307,7 +307,9 @@ module Bundler
# If there is no URI scheme, assume it is an ssh/git URI
input = uri
end
- SharedHelpers.digest(:SHA1).hexdigest(input)
+ # We use SHA1 here for historical reason and to preserve backward compatibility.
+ # But a transition to a simpler mangling algorithm would be welcome.
+ Bundler::Digest.sha1(input)
end
def cached_revision