1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

handle if the file is zero bytes

This commit is contained in:
Zack Scholl 2019-07-19 17:39:25 -07:00
parent ba00eda176
commit fe1329c909

View file

@ -668,6 +668,10 @@ func (c *Client) updateState() (err error) {
continue
}
fileHash, errHash := utils.HashFile(path.Join(fileInfo.FolderRemote, fileInfo.Name))
if fileInfo.Size == 0 {
log.Debugf("touching file with folder / name")
continue
}
log.Debugf("%s %+x %+x %+v", fileInfo.Name, fileHash, fileInfo.Hash, errHash)
if errHash != nil || !bytes.Equal(fileHash, fileInfo.Hash) {
if errHash != nil {