GoogleCloudPlatform / appengine-gcs-client

App Engine-Cloud Storage custom client library
Apache License 2.0
124 stars 112 forks source link

cloudstorage.compose: Allow one source file #50

Closed evanj closed 8 years ago

evanj commented 8 years ago

Previously compose required at least two source files. However, the API itself works with a single file. This can be verified using gsutil.

echo "hello" > example
gsutil cp example gs://test_bucket
gsutil -D compose gs://test_bucket/example gs://test_bucket/composed
gsutil cat gs://test_bucket/composed

Arguably, you may not want to use compose with a single file, but the API does allow it. This also makes it easier to process a list with compose, because you don't need to special case the case where you only have 1 value in the list.

This unit test works for me, but I needed to apply it against the previous commit. See #21 for a description of that issue.

I'm happy to sign Google's CLA.

lklots commented 8 years ago

Thank you for this diff! You just saved a lot of people all sorts of special casing and bugs.