diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-10-11 11:09:27 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-10-11 11:10:33 -0400 |
commit | ba878c4ddc20e58736989584312cb58073160aed (patch) | |
tree | d94a857f3cf940271a8037ebd4173eac6f3898e8 | |
parent | 148aebe3ff9e4953a4800aa0301c8c6038587ed0 (diff) |
webdav: Avoid unncessisarily creating the collection at the top of the repo
when storing files there, since that collection is created by initremote.
(This seems to work around some brokenness of the box.com webdav server
which was entering a redirect loop.)
Note that the fix makes locationParent return Nothing instead of "."
when there's no parent directory between the path and the top of the webdav
repo.
This commit was sponsored by André Pereira on Patreon.
-rw-r--r-- | CHANGELOG | 5 | ||||
-rw-r--r-- | Remote/WebDAV/DavLocation.hs | 5 | ||||
-rw-r--r-- | doc/bugs/Upload_to_box_very_slow.mdwn | 2 |
3 files changed, 10 insertions, 2 deletions
@@ -2,6 +2,11 @@ git-annex (6.20171004) UNRELEASED; urgency=medium * webdav: Make --debug show all webdav operations. * Fix build with aws-0.17. + * webdav: Avoid unncessisarily creating the collection at the top + of the repository when storing files there, since that collection + is created by initremote. + (This seems to work around some brokenness of the box.com webdav + server which was entering a redirect loop.) -- Joey Hess <id@joeyh.name> Sat, 07 Oct 2017 14:11:00 -0400 diff --git a/Remote/WebDAV/DavLocation.hs b/Remote/WebDAV/DavLocation.hs index cbe87e6a7..42c9d35d4 100644 --- a/Remote/WebDAV/DavLocation.hs +++ b/Remote/WebDAV/DavLocation.hs @@ -58,10 +58,11 @@ tmpLocation f = "git-annex-webdav-tmp-" ++ f locationParent :: String -> Maybe String locationParent loc - | loc `elem` tops = Nothing - | otherwise = Just (takeDirectory loc) + | loc `elem` tops || parent `elem` tops = Nothing + | otherwise = Just parent where tops = ["/", "", "."] + parent = takeDirectory loc locationUrl :: URLString -> DavLocation -> URLString locationUrl baseurl loc = baseurl </> loc diff --git a/doc/bugs/Upload_to_box_very_slow.mdwn b/doc/bugs/Upload_to_box_very_slow.mdwn index 4668c80f8..006fe1afa 100644 --- a/doc/bugs/Upload_to_box_very_slow.mdwn +++ b/doc/bugs/Upload_to_box_very_slow.mdwn @@ -118,3 +118,5 @@ Notice the 5 second gap here: ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders) Yes! Thank you! + +> [[fixed|done]] --[[Joey]] |