mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 10:13:52 +08:00
gcs: fix directory marker code #3453
Use Update to upload the directory markers
This commit is contained in:
parent
baf16a65f0
commit
4023eaebe0
|
@ -897,7 +897,8 @@ func (f *Fs) createDirectoryMarker(ctx context.Context, bucket, dir string) erro
|
|||
|
||||
// Object to be uploaded
|
||||
o := &Object{
|
||||
fs: f,
|
||||
fs: f,
|
||||
modTime: time.Now(),
|
||||
}
|
||||
|
||||
for {
|
||||
|
@ -917,7 +918,7 @@ func (f *Fs) createDirectoryMarker(ctx context.Context, bucket, dir string) erro
|
|||
// Upload it if not
|
||||
fs.Debugf(o, "Creating directory marker")
|
||||
content := io.Reader(strings.NewReader(""))
|
||||
_, err = f.Put(ctx, content, o)
|
||||
err = o.Update(ctx, content, o)
|
||||
if err != nil {
|
||||
return fmt.Errorf("creating directory marker failed: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user