Improved locking when multiple git-annex processes are writing to the .git/index file

This commit is contained in:
Joey Hess 2019-05-06 15:15:12 -04:00
parent 4bc99e4c21
commit b03e65d260
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 18 additions and 21 deletions

View file

@ -61,6 +61,7 @@ module Annex.Locations (
gitAnnexMergeDir,
gitAnnexJournalDir,
gitAnnexJournalLock,
gitAnnexGitQueueLock,
gitAnnexPreCommitLock,
gitAnnexMergeLock,
gitAnnexIndex,
@ -410,6 +411,11 @@ gitAnnexJournalDir r = addTrailingPathSeparator $ gitAnnexDir r </> "journal"
gitAnnexJournalLock :: Git.Repo -> FilePath
gitAnnexJournalLock r = gitAnnexDir r </> "journal.lck"
{- Lock file for flushing a git queue that writes to the git index or
- other git state that should only have one writer at a time. -}
gitAnnexGitQueueLock :: Git.Repo -> FilePath
gitAnnexGitQueueLock r = gitAnnexDir r </> "gitqueue.lck"
{- Lock file for the pre-commit hook. -}
gitAnnexPreCommitLock :: Git.Repo -> FilePath
gitAnnexPreCommitLock r = gitAnnexDir r </> "precommit.lck"