Revert "try truncateFilePath on windows again"

This reverts commit 0d4abbcb92.

Test suite was failing again with that.
This commit is contained in:
Joey Hess 2025-01-30 17:43:38 -04:00
parent 0d4abbcb92
commit 8678588e6a
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. - Licensed under the GNU AGPL version 3 or higher.
-} -}
{-# LANGUAGE CPP #-}
module Annex.ReplaceFile ( module Annex.ReplaceFile (
replaceGitAnnexDirFile, replaceGitAnnexDirFile,
replaceGitDirFile, 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' :: (RawFilePath -> Annex ()) -> RawFilePath -> (a -> Bool) -> (RawFilePath -> Annex a) -> Annex a
replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir -> do replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir -> do
#ifndef mingw32_HOST_OS
let basetmp = relatedTemplate' (P.takeFileName file) let basetmp = relatedTemplate' (P.takeFileName file)
#else
let basetmp = toRawFilePath "t"
#endif
withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do
let tmpfile = toRawFilePath tmpdir P.</> basetmp let tmpfile = toRawFilePath tmpdir P.</> basetmp
r <- action tmpfile r <- action tmpfile