avoid bad commits after interrupted direct mode sync (or merge)
It was possible for a interrupted sync or merge in direct mode to leave the work tree out of sync with the last recorded commit. This would result in the next commit seeing files missing from the work tree, and committing their removal. Now, a direct mode merge happens not only in a throwaway work tree, but using a temporary index file, and without any commits or index changes being made until the real work tree has been updated. If the merge is interrupted, the work tree may have some updated files, but worst case a commit will redundantly commit changes that come from the merge. This commit was sponsored by Tony Cantor.
This commit is contained in:
parent
193e702d73
commit
d6711800ad
8 changed files with 142 additions and 47 deletions
|
@ -30,3 +30,7 @@ override index = do
|
|||
|
||||
indexFile :: Repo -> FilePath
|
||||
indexFile r = localGitDir r </> "index"
|
||||
|
||||
{- Git locks the index by creating this file. -}
|
||||
indexFileLock :: Repo -> FilePath
|
||||
indexFileLock r = indexFile r ++ ".lock"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue