try fixing windows test suite

Test suite is failing in windows in conflict resolution tests, where the
automatic conflict resolution adds in a .variant file. On windows, those
files are somehow missing. I don't understand why, and the test failures
only happen on appveyor and not in a local windows VM.

So, since replaceFile was recently changed to remove a windows specific
ifdef, put it back, to see if that is somehow causing these failures.
This commit is contained in:
Joey Hess 2025-01-30 16:31:49 -04:00
parent 4d9d6a5bb5
commit 4bf2e2c696
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -5,6 +5,8 @@
- Licensed under the GNU AGPL version 3 or higher.
-}
{-# LANGUAGE CPP #-}
module Annex.ReplaceFile (
replaceGitAnnexDirFile,
replaceGitDirFile,
@ -57,7 +59,11 @@ replaceFile createdirectory file action = replaceFile' createdirectory file (con
replaceFile' :: (RawFilePath -> Annex ()) -> RawFilePath -> (a -> Bool) -> (RawFilePath -> Annex a) -> Annex a
replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir -> do
#ifndef mingw32_HOST_OS
let basetmp = relatedTemplate' (P.takeFileName file)
#else
let basetmp = toRawFilePath "t"
#endif
withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do
let tmpfile = toRawFilePath tmpdir P.</> basetmp
r <- action tmpfile