clean up git-remote-annex git-annex branch handling
Implemented alternateJournal, which git-remote-annex
uses to avoid any writes to the git-annex branch while setting up
a special remote from an annex:: url.
That prevents the remote.log from being overwritten with the special
remote configuration from the url, which might not be 100% the same as
the existing special remote configuration.
And it prevents an overwrite deleting of other stuff that was
already in the remote.log.
Also, when the branch was created by git-remote-annex, only delete it
at the end if nothing else has been written to it by another command.
This fixes the race condition described in
797f27ab05
, where git-remote-annex
set up the branch and git-annex init and other commands were
run at the same time and their writes to the branch were lost.
This commit is contained in:
parent
d24d8870c5
commit
adcebbae47
6 changed files with 84 additions and 66 deletions
|
@ -36,7 +36,10 @@ data BranchState = BranchState
|
|||
-- process need to be noticed while the current process is running?
|
||||
-- (This makes the journal always be read, and avoids using the
|
||||
-- cache.)
|
||||
, alternateJournal :: Maybe RawFilePath
|
||||
-- ^ use this directory for all journals, rather than the
|
||||
-- gitAnnexJournalDir and gitAnnexPrivateJournalDir.
|
||||
}
|
||||
|
||||
startBranchState :: BranchState
|
||||
startBranchState = BranchState False False False [] [] [] False
|
||||
startBranchState = BranchState False False False [] [] [] False Nothing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue