use subdir for addurl when it creates multiple files

The --file parameter specifies the subdir in this mode.
This commit is contained in:
Joey Hess 2014-12-11 16:09:56 -04:00
parent a941af0fe2
commit bce7e0dd96
3 changed files with 22 additions and 25 deletions

View file

@ -434,10 +434,8 @@ checkurl :: External -> URLString -> Annex UrlContents
checkurl external url =
handleRequest external (CHECKURL url) Nothing $ \req -> case req of
CHECKURL_CONTENTS sz f -> Just $ return $ UrlContents sz
(if null f then id else const f)
CHECKURL_MULTI l -> Just $ return $ UrlNested $ map mknested l
(if null f then Nothing else Just f)
CHECKURL_MULTI l -> Just $ return $ UrlMulti l
CHECKURL_FAILURE errmsg -> Just $ error errmsg
UNSUPPORTED_REQUEST -> error "CHECKURL not implemented by external special remote"
_ -> Nothing
where
mknested (url', sz, f) = (url', UrlContents sz (const f))