diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-12 15:58:36 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-12 15:58:36 -0400 |
commit | 0dba6d2aeefc7755a7674d2c6e1598a238d99412 (patch) | |
tree | 3dca5b12a07d12735acfee8dd1e1b6edb115501d | |
parent | feb92705d8dc038d534813173fc4dba67a7559da (diff) |
fix relaxed with existing file
-rw-r--r-- | Command/AddUrl.hs | 24 | ||||
-rw-r--r-- | doc/bugs/addurl_--relaxed_with_--file_doesn__39__t_actually_relax.mdwn | 2 |
2 files changed, 16 insertions, 10 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index cf8aae17c..ceb35224d 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -60,16 +60,20 @@ perform relaxed url file = ifAnnexed file addurl geturl liftIO $ createDirectoryIfMissing True (parentDir file) ifM (Annex.getState Annex.fast <||> pure relaxed) ( nodownload relaxed url file , download url file ) - addurl (key, _backend) = do - headers <- getHttpHeaders - ifM (liftIO $ Url.check url headers $ keySize key) - ( do - setUrlPresent key url - next $ return True - , do - warning $ "failed to verify url: " ++ url - stop - ) + addurl (key, _backend) + | relaxed = do + setUrlPresent key url + next $ return True + | otherwise = do + headers <- getHttpHeaders + ifM (liftIO $ Url.check url headers $ keySize key) + ( do + setUrlPresent key url + next $ return True + , do + warning $ "failed to verify url: " ++ url + stop + ) download :: String -> FilePath -> CommandPerform download url file = do diff --git a/doc/bugs/addurl_--relaxed_with_--file_doesn__39__t_actually_relax.mdwn b/doc/bugs/addurl_--relaxed_with_--file_doesn__39__t_actually_relax.mdwn index 09e91f380..9118a5041 100644 --- a/doc/bugs/addurl_--relaxed_with_--file_doesn__39__t_actually_relax.mdwn +++ b/doc/bugs/addurl_--relaxed_with_--file_doesn__39__t_actually_relax.mdwn @@ -22,3 +22,5 @@ Debian Sid supported repository versions: 3 4 upgrade supported from repository versions: 0 1 2 build flags: Assistant Webapp Pairing Testsuite S3 WebDAV Inotify DBus XMPP DNS + +> Missed the case of adding an url to an existing file. [[done]] --[[Joey]] |