aws/aws-cli — pull request #537 by jamesls (2013-12-06 23:32:29+00:00)
Title: Use HeadObject to retrieve fileinfo for single file

The fix for #328 resulted in dummy data being used for
the last modified and the file size.

While this functionally still works, this actually causes an issue
in that we don't have the file size available to determine whether or
not we should download the file in parallel. This is also going
to be problematic for multipart copies where we need to determine if we
need to use a multipart upload for the s3->s3 copy.

The permissions referenced in the original issue should still hold, you
only need s3:GetObject, ListObjects is not needed.

I've updated the tests to verify that the fileinfo objects we get back
are the actual size of the files in s3. Previously they were just
setting their size to actual_value.size, which would never fail.

One final thing added for this change was more detailed error messages.
The HeadObject is going to be the first operation we try, so if anything
goes wrong (key does not exist, permissions issues, etc) this will be
the first error message someone will see.