From c6b844977ae55fd2b1223a167f25839753b7d78a Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 7 Aug 2017 17:36:59 +0100 Subject: [PATCH] sftp: clear the cached hashes on object update --- sftp/sftp.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sftp/sftp.go b/sftp/sftp.go index 6e0fd8865..837d4cd89 100644 --- a/sftp/sftp.go +++ b/sftp/sftp.go @@ -817,6 +817,9 @@ func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) { // Update a remote sftp file using the data and ModTime from func (o *Object) Update(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { + // Clear the hash cache since we are about to update the object + o.md5sum = nil + o.sha1sum = nil c, err := o.fs.getSftpConnection() if err != nil { return errors.Wrap(err, "Update")