From d4aed83aa6f7d0111702732b0510e2dc85008550 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 4 Jan 2021 11:18:16 -0800 Subject: [PATCH] working_copy: correct comment about stat accuracy We don't take a write lock when writing a file; other processes can modify the file. --- lib/src/working_copy.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index dfda484a0..2174d8d98 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -370,9 +370,9 @@ impl TreeState { let mut contents = self.store.read_file(path, id).unwrap(); std::io::copy(&mut contents, &mut file).unwrap(); self.set_executable(disk_path, executable); - // Read the file state while we still have the write lock. That way there is no - // race with other processes modifying it. We know that the file exists, - // and we know that the stat information is accurate. (The mtime is set + // Read the file state while we still have the file open. That way, know that + // the file exists, and the stat information is most likely accurate, + // except for other processes modifying the file concurrently (The mtime is set // at write time and won't change when we close the file.) self.file_state(&disk_path).unwrap() }