summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
Diffstat (limited to 'Remote')
-rw-r--r--Remote/WebDAV.hs6
-rw-r--r--Remote/WebDAV/DavLocation.hs11
2 files changed, 7 insertions, 10 deletions
diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs
index 61fc70324..ce27dd551 100644
--- a/Remote/WebDAV.hs
+++ b/Remote/WebDAV.hs
@@ -127,7 +127,7 @@ store _ (Just dav) = httpStorer $ \k reqbody -> liftIO $ goDAV dav $ do
storeHelper :: DavHandle -> DavLocation -> DavLocation -> RequestBody -> DAVT IO ()
storeHelper dav tmp dest reqbody = do
- void $ mkColRecursive tmpDir
+ maybe noop (void . mkColRecursive) (locationParent tmp)
inLocation tmp $
putContentM' (contentType, reqbody)
finalizeStore dav tmp dest
@@ -257,8 +257,8 @@ testDav url (Just (u, p)) = do
test $ liftIO $ evalDAVT url $ do
prepDAV user pass
makeParentDirs
- void $ mkColRecursive tmpDir
- inLocation (tmpLocation "git-annex-test") $ do
+ void $ mkColRecursive "/"
+ inLocation (tmpLocation "test") $ do
putContentM (Nothing, L8.fromString "test")
delContentM
where
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