git-annex/Utility
Joey Hess af3b9cbd36
simplify replaceFile using relatedTemplate
Now that truncateFilePath and relatedTemplate have both been optimised,
may as well use them in replaceFile, rather than the custom hack it
used.

Removed the windows-specific ifdef as well, because on Windows long
filepaths no longer really a problem, since ghc and git-annex use UNC
converted paths.

replaceFile no longer checks fileNameLengthLimit. That took a syscall,
and since we have an existing file, we know filenames of its length are
supported by the filesystem. Assuming that the withOtherTmp directory is
on the same filesystem as the file replaceFile is being called on, which
I believe it is.

Sponsored-by: Leon Schuermann
2025-01-22 13:25:06 -04:00
..
Directory RawFilePath conversion for Utility.Directory.Stream 2025-01-20 19:25:52 -04:00
DirWatcher RawFilePath conversion of System.Directory 2025-01-20 19:17:33 -04:00
Env fix a annex.pidlock issue 2020-06-17 15:30:59 -04:00
LockFile use openTempFile from file-io 2025-01-22 11:41:43 -04:00
LockPool avoid annexFileMode special case 2023-04-27 15:58:37 -04:00
Path run codespell throughout fixing typos automagically 2024-05-01 15:46:21 -04:00
Process fix missing new lines in processTranscript 2021-08-02 13:42:27 -04:00
Scheduled Typo: recurrance -> recurrence 2023-03-17 15:14:54 -04:00
Tmp use openTempFile from file-io 2025-01-22 11:41:43 -04:00
Url fix build on windows 2023-08-18 13:03:47 -04:00
Aeson.hs remove i386ancient and need at least debian stable to build 2025-01-01 14:15:55 -04:00
Android.hs explict export lists 2019-11-21 16:08:37 -04:00
Applicative.hs squelch tab warnings 2019-11-22 12:49:41 -04:00
Attoparsec.hs fix git ls-tree parser 2019-12-06 14:05:48 -04:00
AuthToken.hs filter out control characters in error messages 2023-04-10 13:50:51 -04:00
Base64.hs simplify base64 to only use ByteString 2023-10-26 13:10:05 -04:00
Batch.hs add searchPathContents 2021-02-02 19:06:15 -04:00
Bloom.hs Apply codespell -w throughout 2023-03-17 15:14:58 -04:00
CoProcess.hs make commitMigration interuption safe 2023-12-06 16:29:58 -04:00
CopyFile.hs fix comment 2023-03-28 12:40:08 -04:00
Daemon.hs fix build with unix-2.8.0 2023-08-01 18:41:27 -04:00
Data.hs eliminate s2w8 and w82s 2023-10-26 13:12:57 -04:00
DataUnits.hs remove read of the heads 2024-09-26 18:43:59 -04:00
DBus.hs explict export lists 2019-11-21 16:08:37 -04:00
Debug.hs Revert "use existing debug machinery for explain" 2023-07-25 15:53:50 -04:00
DebugLocks.hs explict export lists 2019-11-21 16:08:37 -04:00
Directory.hs add file-io to build-depends when building with OsPath flag 2025-01-21 14:26:04 -04:00
DirWatcher.hs explict export lists 2019-11-21 16:08:37 -04:00
DiskFree.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Dot.hs explict export lists 2019-11-21 16:08:37 -04:00
DottedVersion.hs more RawFilePath conversion 2020-10-29 12:03:50 -04:00
Env.hs explict export lists 2019-11-21 16:08:37 -04:00
Exception.hs avoid displaying ExitCode exceptions 2023-04-12 17:04:57 -04:00
FileIO.hs use openTempFile from file-io 2025-01-22 11:41:43 -04:00
FileMode.hs add file-io to build-depends when building with OsPath flag 2025-01-21 14:26:04 -04:00
FileSize.hs add file-io to build-depends when building with OsPath flag 2025-01-21 14:26:04 -04:00
FileSystemEncoding.hs optimize truncateFilePath 2025-01-22 13:09:15 -04:00
Format.hs find, findkeys, examinekey: escape output to terminal when --format is not used 2023-04-11 15:27:07 -04:00
FreeDesktop.hs use System.Directory not Utility.Directory 2016-09-22 11:34:55 -04:00
Glob.hs Typo: sansative -> sensitive 2023-03-17 15:14:50 -04:00
Gpg.hs run codespell throughout fixing typos automagically 2024-05-01 15:46:21 -04:00
Hash.hs use hmac in balanced preferred content 2024-08-10 16:32:54 -04:00
HtmlDetect.hs add file-io to build-depends when building with OsPath flag 2025-01-21 14:26:04 -04:00
HumanNumber.hs Fix a rounding bug in display of data sizes 2021-07-30 09:56:04 -04:00
HumanTime.hs avoid parseDuration succeeding on empty string 2020-12-08 12:51:56 -04:00
InodeCache.hs fix build warnings on windows 2023-03-21 18:41:23 -04:00
IPAddress.hs Apply codespell -w throughout 2023-03-17 15:14:58 -04:00
libkqueue.c update my email address and homepage url 2015-01-21 12:50:09 -04:00
libkqueue.h fix prototype 2012-06-19 01:57:19 -04:00
LinuxMkLibs.hs stop exporting Utility.SystemDirectory from Utility.Directory 2025-01-20 19:10:25 -04:00
LockFile.hs use lock pools throughout git-annex 2015-05-19 14:09:52 -04:00
LockPool.hs Fix shared lock file FD leak. 2016-03-01 15:31:39 -04:00
LogFile.hs avoid unix-compat's rename 2022-07-12 14:55:02 -04:00
Lsof.hs filter out control characters in error messages 2023-04-10 13:50:51 -04:00
MagicWormhole.hs fix breakage in wormhole's sendFile 2022-09-26 15:26:29 -04:00
Matcher.hs treat "not present" in preferred content as invalid 2024-09-03 13:50:06 -04:00
MD5.hs use filepath-bytestring for annex object manipulations 2019-12-11 15:25:07 -04:00
Metered.hs RawFilePath conversion 2024-01-19 14:26:21 -04:00
Misc.hs remove read of the heads 2024-09-26 18:43:59 -04:00
Monad.hs Add git-annex remote refs that are not newer to the merged refs list 2023-08-09 13:31:36 -04:00
MonotonicClock.hs remove i386ancient and need at least debian stable to build 2025-01-01 14:15:55 -04:00
Mounts.hs removed the old Android app 2018-10-13 01:41:11 -04:00
MoveFile.hs use openTempFile from file-io 2025-01-22 11:41:43 -04:00
Network.hs explict export lists 2019-11-21 16:08:37 -04:00
NotificationBroadcaster.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
OpenFd.hs avoid cpp failure on windows 2023-08-02 10:08:00 -04:00
OpenFile.hs fix build on windows 2024-10-18 10:17:07 -04:00
OptParse.hs explict export lists 2019-11-21 16:08:37 -04:00
OsPath.hs use openTempFile from file-io 2025-01-22 11:41:43 -04:00
OSX.hs explict export lists 2019-11-21 16:08:37 -04:00
PartialPrelude.hs remove read of the heads 2024-09-26 18:43:59 -04:00
Path.hs improve attribution armoring 2023-11-21 11:34:21 -04:00
Percentage.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
PID.hs explict export lists 2019-11-21 16:08:37 -04:00
Process.hs remove i386ancient and need at least debian stable to build 2025-01-01 14:15:55 -04:00
QuickCheck.hs run codespell throughout fixing typos automagically 2024-05-01 15:46:21 -04:00
RawFilePath.hs Windows: Support long filenames in more (possibly all) of the code 2023-03-01 15:55:58 -04:00
ResourcePool.hs use ResourcePool for hash-object handles 2022-07-25 17:32:39 -04:00
Rsync.hs Parse youtube-dl progress output 2020-09-29 17:53:48 -04:00
SafeCommand.hs add newtypes for QuickCheck to avoid LANG=C issues 2020-11-09 20:21:18 -04:00
SafeOutput.hs remove unused imports 2023-04-12 16:48:18 -04:00
Scheduled.hs Typo: recurrance -> recurrence 2023-03-17 15:14:54 -04:00
Shell.hs add searchPathContents 2021-02-02 19:06:15 -04:00
ShellEscape.hs improve attribution armoring 2023-11-21 11:34:21 -04:00
SimpleProtocol.hs P2P protocol version 2, adding SUCCESS-PLUS and ALREADY-HAVE-PLUS 2024-06-18 16:21:40 -04:00
Split.hs reword comment 2019-11-27 16:38:18 -04:00
SshConfig.hs use openTempFile from file-io 2025-01-22 11:41:43 -04:00
SshHost.hs avoid the dashed ssh hostname class of security holes 2017-08-17 22:11:31 -04:00
StatelessOpenPGP.hs use openTempFile from file-io 2025-01-22 11:41:43 -04:00
STM.hs Allow enabling the servant build flag with older versions of stm 2024-10-17 20:55:31 -04:00
Su.hs fix build warning 2022-10-27 10:21:24 -04:00
SystemDirectory.hs small RawFilePath optimisation 2023-03-02 10:53:12 -04:00
Tense.hs explict export lists 2019-11-23 11:24:10 -04:00
Terminal.hs Windows: Fix escaping output to terminal when using old versions of MinTTY 2024-03-26 13:09:21 -04:00
ThreadLock.hs explict export lists 2019-11-23 11:24:10 -04:00
ThreadScheduler.hs fix build warnings on windows 2024-03-26 13:11:53 -04:00
TimeStamp.hs remove i386ancient and need at least debian stable to build 2025-01-01 14:15:55 -04:00
TList.hs remove i386ancient and need at least debian stable to build 2025-01-01 14:15:55 -04:00
Tmp.hs simplify replaceFile using relatedTemplate 2025-01-22 13:25:06 -04:00
Tor.hs remove i386ancient and need at least debian stable to build 2025-01-01 14:15:55 -04:00
Touch.hs fix build on windows 2020-11-16 09:31:45 -04:00
Tuple.hs explict export lists 2019-11-23 11:24:10 -04:00
Url.hs split out Utility.Url.Parse 2023-08-14 12:28:10 -04:00
UserInfo.hs fix build on windows 2023-08-02 10:43:20 -04:00
Verifiable.hs use hmac in balanced preferred content 2024-08-10 16:32:54 -04:00
WebApp.hs use openTempFile from file-io 2025-01-22 11:41:43 -04:00
Yesod.hs Apply codespell -w throughout 2023-03-17 15:14:58 -04:00