improve addurl --file behavior in a confusing corner case involving a ftp url
This commit is contained in:
parent
f02cf1ab5a
commit
1c965f5918
2 changed files with 15 additions and 11 deletions
|
@ -134,17 +134,20 @@ perform relaxed url file = ifAnnexed file addurl geturl
|
||||||
| relaxed = do
|
| relaxed = do
|
||||||
setUrlPresent key url
|
setUrlPresent key url
|
||||||
next $ return True
|
next $ return True
|
||||||
| otherwise = do
|
| otherwise = ifM (elem url <$> getUrls key)
|
||||||
|
( stop
|
||||||
|
, do
|
||||||
(exists, samesize) <- Url.withUrlOptions $ Url.check url (keySize key)
|
(exists, samesize) <- Url.withUrlOptions $ Url.check url (keySize key)
|
||||||
if exists && samesize
|
if exists && samesize
|
||||||
then do
|
then do
|
||||||
setUrlPresent key url
|
setUrlPresent key url
|
||||||
next $ return True
|
next $ return True
|
||||||
else do
|
else do
|
||||||
warning $ if exists
|
warning $ "while adding a new url to an already annexed file, " ++ if exists
|
||||||
then "url does not have expected file size (use --relaxed to bypass this check) " ++ url
|
then "url does not have expected file size (use --relaxed to bypass this check) " ++ url
|
||||||
else "failed to verify url exists: " ++ url
|
else "failed to verify url exists: " ++ url
|
||||||
stop
|
stop
|
||||||
|
)
|
||||||
|
|
||||||
addUrlFile :: Bool -> URLString -> FilePath -> Annex Bool
|
addUrlFile :: Bool -> URLString -> FilePath -> Annex Bool
|
||||||
addUrlFile relaxed url file = do
|
addUrlFile relaxed url file = do
|
||||||
|
|
|
@ -64,3 +64,4 @@ I am using current git-annex binary linux version on Fedora 19.
|
||||||
supported repository version: 5
|
supported repository version: 5
|
||||||
upgrade supported from repository versions: 0 1 2 4
|
upgrade supported from repository versions: 0 1 2 4
|
||||||
|
|
||||||
|
> [[done]] --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue