fix exporting when the file is in the top of the repo
takeDirectory "foo" is ".", and that will confuse webdav, so only use that code path when there is a subdirectory.
This commit is contained in:
parent
4a2d148599
commit
3337f7c272
2 changed files with 20 additions and 2 deletions
|
@ -62,10 +62,20 @@ exportLocation l =
|
||||||
keyTmpLocation :: Key -> DavLocation
|
keyTmpLocation :: Key -> DavLocation
|
||||||
keyTmpLocation = tmpLocation . fromRawFilePath . keyFile
|
keyTmpLocation = tmpLocation . fromRawFilePath . keyFile
|
||||||
|
|
||||||
|
{- Where we store temporary data for a file as it's being exported.
|
||||||
|
-
|
||||||
|
- This could be just the keyTmpLocation, but when the file is in a
|
||||||
|
- subdirectory, the temp file is put in there. Partly this is to keep
|
||||||
|
- it close to the final destination; also certian webdav servers
|
||||||
|
- seem to be buggy when renaming files from the root into a subdir,
|
||||||
|
- and so writing to the subdir avoids such problems.
|
||||||
|
-}
|
||||||
exportTmpLocation :: ExportLocation -> Key -> DavLocation
|
exportTmpLocation :: ExportLocation -> Key -> DavLocation
|
||||||
exportTmpLocation l k = d </> keyTmpLocation k
|
exportTmpLocation l k
|
||||||
|
| length (splitDirectories p) > 1 = takeDirectory p </> keyTmpLocation k
|
||||||
|
| otherwise = keyTmpLocation k
|
||||||
where
|
where
|
||||||
d = takeDirectory (fromRawFilePath (fromExportLocation l))
|
p = fromRawFilePath (fromExportLocation l)
|
||||||
|
|
||||||
tmpLocation :: FilePath -> DavLocation
|
tmpLocation :: FilePath -> DavLocation
|
||||||
tmpLocation f = "git-annex-webdav-tmp-" ++ f
|
tmpLocation f = "git-annex-webdav-tmp-" ++ f
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 6"""
|
||||||
|
date="2021-03-16T18:13:45Z"
|
||||||
|
content="""
|
||||||
|
I think I see how my change broke exporting to the top directory of the
|
||||||
|
repo. I've committed a fix for that.
|
||||||
|
"""]]
|
Loading…
Add table
Reference in a new issue