summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Command')
-rw-r--r--Command/AddUrl.hs12
-rw-r--r--Command/Status.hs2
2 files changed, 8 insertions, 6 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
diff --git a/Command/Status.hs b/Command/Status.hs
index 21d46c5ec..9da1bea98 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -70,7 +70,7 @@ data StatInfo = StatInfo
type StatState = StateT StatInfo Annex
def :: [Command]
-def = [command "status" paramPaths seek
+def = [noCommit $ command "status" paramPaths seek
SectionQuery "shows status information about the annex"]
seek :: [CommandSeek]