浏览代码

Fix typo that made change detection break

We were comparing the old and old mtimes rather than the old and
the new. This meant we missed some file changes where only the mtime
changed.
Alexander Larsson 11 年之前
父节点
当前提交
bc1c5ddf2e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      changes.go

+ 1 - 1
changes.go

@@ -119,7 +119,7 @@ func (info *FileInfo) addChanges(oldInfo *FileInfo, changes *[]Change) {
 			// breaks down is if some code intentionally hides a change by setting
 			// breaks down is if some code intentionally hides a change by setting
 			// back mtime
 			// back mtime
 			oldMtime := syscall.NsecToTimeval(oldStat.Mtim.Nano())
 			oldMtime := syscall.NsecToTimeval(oldStat.Mtim.Nano())
-			newMtime := syscall.NsecToTimeval(oldStat.Mtim.Nano())
+			newMtime := syscall.NsecToTimeval(newStat.Mtim.Nano())
 			if oldStat.Mode != newStat.Mode ||
 			if oldStat.Mode != newStat.Mode ||
 				oldStat.Uid != newStat.Uid ||
 				oldStat.Uid != newStat.Uid ||
 				oldStat.Gid != newStat.Gid ||
 				oldStat.Gid != newStat.Gid ||