From 033bfe7d5bec0b211e582bfea1e378b97929e1ed Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 3 Nov 2021 15:20:11 -0700 Subject: [PATCH] working_copy: fix an incorrect comment about timestamps --- lib/src/working_copy.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index 0f107dace..ae63ce5be 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -251,10 +251,10 @@ impl TreeState { } let mut temp_file = NamedTempFile::new_in(&self.state_path).unwrap(); - // update read time while we still have the file open for writes, so we know + proto.write_to_writer(temp_file.as_file_mut()).unwrap(); + // update own write time while we before we rename it, so we know // there is no unknown data in it self.update_own_mtime(); - proto.write_to_writer(temp_file.as_file_mut()).unwrap(); // TODO: Retry if persisting fails (it will on Windows if the file happened to // be open for read). temp_file