url size fixes

addurl: Improve message when adding url with wrong size to existing file.
Before the message suggested the url didn't exist.

Fixed handling of URL keys that have no recorded size. Before, if the key
has no size, the url also had to not declare any size, which was unlikely
and wrong, or it was taken to not exist. This probably would mostly affect
keys that were added to the annex with addurl --relaxed.
This commit is contained in:
Joey Hess 2013-10-11 13:05:00 -04:00
parent 5797364a07
commit 747f5b123c
5 changed files with 22 additions and 11 deletions

View file

@ -241,7 +241,7 @@ inAnnex r key
where
checkhttp headers = do
showChecking r
ifM (anyM (\u -> Url.withUserAgent $ Url.check u headers (keySize key)) (keyUrls r key))
ifM (anyM (\u -> Url.withUserAgent $ Url.checkBoth u headers (keySize key)) (keyUrls r key))
( return $ Right True
, return $ Left "not found"
)