diff options
author | Thomas Marshall <[email protected]> | 2025-06-02 13:16:23 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2025-06-06 10:09:14 +0900 |
commit | ee55b82b34017051e6854a7940efc1615a693242 () | |
tree | a827a67958cc8ce94d2e49e9a1e1b539b55b1e80 /lib | |
parent | 6839eadd5312b7d2f15415a5f65677cb71d39a1c (diff) |
[rubygems/rubygems] Cache commit SHA ref revisions
If the `ref` option is a specific commit SHA, we can check to see if it's already fetched locally. If it is, then we don't need to re-fetch it from the remote. The `ref` option might not be a commit SHA, so we're using the `#commit` method which returns the full SHA if it's a commit ref, or the locked revision, or nil. This is a small improvement that will make `bundle update` slightly faster in cases for git-sourced gems pinned to a specific commit. https://.com/rubygems/rubygems/commit/f434c2e66c
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -305,8 +305,8 @@ module Bundler end def has_revision_cached? - return unless @revision && path.exist? - git("cat-file", "-e", @revision, dir: path) true rescue GitError false |