diff options
-rw-r--r-- | lib/bundler/compact_index_client/updater.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb index 185ebc86..b407c640 100644 --- a/lib/bundler/compact_index_client/updater.rb +++ b/lib/bundler/compact_index_client/updater.rb @@ -30,7 +30,7 @@ module Bundler Dir.mktmpdir("bundler-compact-index-") do |local_temp_dir| local_temp_path = Pathname.new(local_temp_dir).join(local_path.basename) - # download new file if retrying + # first try to fetch any new bytes on the existing file if retrying.nil? && local_path.file? FileUtils.cp local_path, local_temp_path headers["If-None-Match"] = etag_for(local_temp_path) @@ -61,7 +61,7 @@ module Bundler return nil end - unless retrying.nil? + if retrying raise MisMatchedChecksumError.new(remote_path, response_etag, etag_for(local_temp_path)) end |