summaryrefslogtreecommitdiff
path: root/Remote/WebDAV
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-09-15 15:52:31 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-09-15 15:52:31 -0400
commit4c88513e1894c4d02dd7b1cc5dc1e3d536429f13 (patch)
tree70f0784ad261e9f7150a9518e6b87d5de31cd854 /Remote/WebDAV
parent24d7320583f744f09bbee393ff7fd82121c32b96 (diff)
webdav: Changed path used on webdav server for temporary files.
Done to avoid a "tmp" directory appearing in webdav exports. Also affects non-export webdav remotes, so interrupted uploads using the old path will not overwrite it. However, PUT is quite likely to be implemented atomically on web servers anyway, so I doubt this will cause problems.
Diffstat (limited to 'Remote/WebDAV')
-rw-r--r--Remote/WebDAV/DavLocation.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/Remote/WebDAV/DavLocation.hs b/Remote/WebDAV/DavLocation.hs
index 8979ab9ef..74b4831ea 100644
--- a/Remote/WebDAV/DavLocation.hs
+++ b/Remote/WebDAV/DavLocation.hs
@@ -46,18 +46,15 @@ keyDir k = addTrailingPathSeparator $ hashdir </> keyFile k
keyLocation :: Key -> DavLocation
keyLocation k = keyDir k ++ keyFile k
+exportLocation :: ExportLocation -> DavLocation
+exportLocation (ExportLocation f) = f
+
{- Where we store temporary data for a key as it's being uploaded. -}
keyTmpLocation :: Key -> DavLocation
keyTmpLocation = tmpLocation . keyFile
-exportLocation :: ExportLocation -> DavLocation
-exportLocation (ExportLocation f) = f
-
tmpLocation :: FilePath -> DavLocation
-tmpLocation f = tmpDir </> f
-
-tmpDir :: DavLocation
-tmpDir = "tmp"
+tmpLocation f = "git-annex-webdav-tmp-" ++ f
locationParent :: String -> Maybe String
locationParent loc