-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read-cache: close index.lock in do_write_index #1149
read-cache: close index.lock in do_write_index #1149
Conversation
Teach do_write_index() to close the index.lock file before getting the mtime and updating the istate.timestamp fields. On Windows, a file's mtime is not updated until the file is closed. On Linux, the mtime is set after the last flush. Signed-off-by: Jeff Hostetler <[email protected]>
@dscho Here is an updated version of what we talked about this morning. It's mostly what you started with, but I updated the fstat() call at the bottom of do_write_index(). I'll save the optimization stuff for another PR. |
Thanks! We may want to suppress the error message when we failed to close, as the other failures are also silent. But that will be my Duck when submitting the patch upstream, always good to have a Duck. |
When writing the Git index file, Git for Windows [no longer has the wrong idea about the file's timestamp](git-for-windows/git#1149). Signed-off-by: Johannes Schindelin <[email protected]>
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
…dex_mtime read-cache: close index.lock in do_write_index
Teach do_write_index() to close the index.lock file
before getting the mtime and updating the istate.timestamp
fields.
On Windows, a file's mtime is not updated until the file is
closed. On Linux, the mtime is set after the last flush.
Signed-off-by: Jeff Hostetler [email protected]