From 36cc42a9cad5eaaa0030287b4c48e00ae38abd3e Mon Sep 17 00:00:00 2001 From: glaszig Date: Sun, 5 Jul 2015 18:27:41 +0200 Subject: [PATCH] S3: skip md5 hashing if incremental uploads aren't even enabled --- lib/octopress-deploy/s3.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/octopress-deploy/s3.rb b/lib/octopress-deploy/s3.rb index ad7e605..fa36347 100644 --- a/lib/octopress-deploy/s3.rb +++ b/lib/octopress-deploy/s3.rb @@ -279,10 +279,12 @@ def self.default_config(options={}) protected def write_file? file + return false unless @incremental + file_digest = Digest::MD5.file(file).hexdigest o = s3_object file s3sum = o.etag.tr('"','') if o.exists? - @incremental == false || s3sum.to_s != file_digest + s3sum.to_s != file_digest end def s3_object file