mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
address @efiop's suggestions
This commit is contained in:
+2
-2
@@ -213,11 +213,11 @@ class RemoteS3(RemoteBASE):
|
||||
return path_info.path == fname or fname.startswith(dir_path.path)
|
||||
|
||||
def makedirs(self, path_info):
|
||||
# We need to support creating empty directories, on S3, that means
|
||||
# We need to support creating empty directories, which means
|
||||
# creating an object with an empty body and a trailing slash `/`.
|
||||
#
|
||||
# We are not creating directory objects for every parent prefix,
|
||||
# it doesn't make sense.
|
||||
# as it is not required.
|
||||
dir_path = path_info / ""
|
||||
self.s3.put_object(Bucket=path_info.bucket, Key=dir_path.path, Body="")
|
||||
|
||||
|
||||
@@ -103,8 +103,8 @@ def test_copy_preserve_etag_across_buckets(remote):
|
||||
assert from_etag == to_etag
|
||||
|
||||
|
||||
def makedirs(remote):
|
||||
empty_dir = remote.path_info / "empty_dir"
|
||||
def test_makedirs(remote):
|
||||
empty_dir = remote.path_info / "empty_dir" / ""
|
||||
remote.remove(empty_dir)
|
||||
assert not remote.exists(empty_dir)
|
||||
remote.makedirs(empty_dir)
|
||||
|
||||
Reference in New Issue
Block a user