You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commit 7f23eb4 introduced support for including modifications from the
last commit when amending. Unfortunately, this introduces a new case
where renaming a file as part of an amendment would result in a crash as
Overcommit would try to update the modification time of the non-existent
old file.
This also had the nasty effect of losing the user's changes, which is a
regression that was introduced in c3d972d. I'll be addressing that in a
separate commit.
A simple workaround here is to simply not bother updating the
modification time if the file does not exist.
Note that `File.mtime` sometimes behaves strangely here--I've seen it
return `nil` for files that don't exist, but raise errors at other times
(and I have no idea under which conditions one outcome occurs versus the
other).
It's easiest to just check if the file exists before we call `mtime`.
0 commit comments