diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-11 14:21:06 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-11 14:21:06 -0400 |
commit | 388d27825323091f317ed380e3105f88df3f66cb (patch) | |
tree | 24e27eef33ae4949affe6d42079dd07d7a925cc2 /Command/AddUrl.hs | |
parent | 6af9822118dca6c9416c0d13635b13ee68bd13f6 (diff) | |
parent | f81b89510d558ee38e6338c433e4f1b01c2cd5f3 (diff) |
Merge branch 'master' into incrementalfsck
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r-- | Command/AddUrl.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index b90297f27..27ca72d1a 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -124,14 +124,16 @@ perform relaxed url file = ifAnnexed file addurl geturl next $ return True | otherwise = do headers <- getHttpHeaders - ifM (Url.withUserAgent $ Url.check url headers $ keySize key) - ( do + (exists, samesize) <- Url.withUserAgent $ Url.check url headers $ keySize key + if exists && samesize + then do setUrlPresent key url next $ return True - , do - warning $ "failed to verify url exists: " ++ url + else do + warning $ if exists + then "url does not have expected file size (use --relaxed to bypass this check) " ++ url + else "failed to verify url exists: " ++ url stop - ) addUrlFile :: Bool -> URLString -> FilePath -> Annex Bool addUrlFile relaxed url file = do |