fix failing test case on Windows
ensure file being modified is all read before it's opened for write
This commit is contained in:
parent
1572c460e8
commit
08afe3a1f6
3 changed files with 5 additions and 6 deletions
|
@ -54,7 +54,10 @@ associatedFilesRelative key = do
|
||||||
mapping <- calcRepo $ gitAnnexMapping key
|
mapping <- calcRepo $ gitAnnexMapping key
|
||||||
liftIO $ catchDefaultIO [] $ withFile mapping ReadMode $ \h -> do
|
liftIO $ catchDefaultIO [] $ withFile mapping ReadMode $ \h -> do
|
||||||
fileEncoding h
|
fileEncoding h
|
||||||
lines <$> hGetContents h
|
-- Read strictly to ensure the file is closed
|
||||||
|
-- before changeAssociatedFiles tries to write to it.
|
||||||
|
-- (Especially needed on Windows.)
|
||||||
|
lines <$> hGetContentsStrict h
|
||||||
|
|
||||||
{- Changes the associated files information for a key, applying a
|
{- Changes the associated files information for a key, applying a
|
||||||
- transformation to the list. Returns new associatedFiles value. -}
|
- transformation to the list. Returns new associatedFiles value. -}
|
||||||
|
|
|
@ -145,7 +145,7 @@ storeEncrypted r buprepo (cipher, enck) k _p =
|
||||||
retrieve :: BupRepo -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> Annex Bool
|
retrieve :: BupRepo -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> Annex Bool
|
||||||
retrieve buprepo k _f d _p = do
|
retrieve buprepo k _f d _p = do
|
||||||
let params = bupParams "join" buprepo [Param $ bupRef k]
|
let params = bupParams "join" buprepo [Param $ bupRef k]
|
||||||
liftIO $ catchBoolIO $ withFIle d WriteMode $
|
liftIO $ catchBoolIO $ withFile d WriteMode $
|
||||||
pipeBup params Nothing . Just
|
pipeBup params Nothing . Just
|
||||||
|
|
||||||
retrieveCheap :: BupRepo -> Key -> FilePath -> Annex Bool
|
retrieveCheap :: BupRepo -> Key -> FilePath -> Annex Bool
|
||||||
|
|
|
@ -12,10 +12,6 @@ now! --[[Joey]]
|
||||||
is much slower than on systems supporting connection caching.
|
is much slower than on systems supporting connection caching.
|
||||||
* The test suite does not 100% pass, although it seems to be getting
|
* The test suite does not 100% pass, although it seems to be getting
|
||||||
quite close! Current known failures:
|
quite close! Current known failures:
|
||||||
* unannex test fails, but only around 50% or less of the time,
|
|
||||||
while updating the .map file. Renaming the new file into place fails
|
|
||||||
with permission denied. Possibly something else has the file
|
|
||||||
open?
|
|
||||||
* "conflict_resolution (mixed directory and file)" test fails;
|
* "conflict_resolution (mixed directory and file)" test fails;
|
||||||
not because the conflict resolution fails, but the sync fails
|
not because the conflict resolution fails, but the sync fails
|
||||||
pushing to synced/master with a non-fast-forward failure.
|
pushing to synced/master with a non-fast-forward failure.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue