aboutsummaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-11 14:21:06 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-11 14:21:06 -0400
commit388d27825323091f317ed380e3105f88df3f66cb (patch)
tree24e27eef33ae4949affe6d42079dd07d7a925cc2 /Command
parent6af9822118dca6c9416c0d13635b13ee68bd13f6 (diff)
parentf81b89510d558ee38e6338c433e4f1b01c2cd5f3 (diff)
Merge branch 'master' into incrementalfsck
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]