fixed reconcileStaged crash when index is locked or in conflict
Eg, when git commit runs the smudge filter.
Commit 428c91606b
introduced the crash,
as write-tree fails in those situations. Now it will work, and git-annex
always gets up-to-date information even in those situations. It does
need to do a bit more work, each time git-annex is run with the index
locked. Although if the index is unmodified from the last time
write-tree succeeded, that work is avoided.
This commit is contained in:
parent
3698e804d4
commit
efae085272
3 changed files with 47 additions and 26 deletions
|
@ -70,17 +70,15 @@ pipeReadLazy params repo = assertLocal repo $ do
|
|||
- Nonzero exit status is ignored.
|
||||
-}
|
||||
pipeReadStrict :: [CommandParam] -> Repo -> IO S.ByteString
|
||||
pipeReadStrict = pipeReadStrict' S.hGetContents
|
||||
pipeReadStrict = pipeReadStrict' id
|
||||
|
||||
{- The reader action must be strict. -}
|
||||
pipeReadStrict' :: (Handle -> IO a) -> [CommandParam] -> Repo -> IO a
|
||||
pipeReadStrict' reader params repo = assertLocal repo $ withCreateProcess p go
|
||||
pipeReadStrict' :: (CreateProcess -> CreateProcess) -> [CommandParam] -> Repo -> IO S.ByteString
|
||||
pipeReadStrict' fp params repo = assertLocal repo $ withCreateProcess p go
|
||||
where
|
||||
p = (gitCreateProcess params repo)
|
||||
{ std_out = CreatePipe }
|
||||
p = fp (gitCreateProcess params repo) { std_out = CreatePipe }
|
||||
|
||||
go _ (Just outh) _ pid = do
|
||||
output <- reader outh
|
||||
output <- S.hGetContents outh
|
||||
hClose outh
|
||||
void $ waitForProcess pid
|
||||
return output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue