registerurl: Check if a remote claims the url, same as addurl does.

This commit is contained in:
Joey Hess 2016-01-19 15:46:32 -04:00
parent 432151f966
commit 68edd308af
Failed to extract signature
2 changed files with 7 additions and 1 deletions

View file

@ -14,6 +14,7 @@ import Command
import Logs.Web
import Annex.UUID
import Command.FromKey (mkKey)
import qualified Remote
cmd :: Command
cmd = notDirect $ notBareRepo $
@ -53,5 +54,9 @@ perform key url = do
perform' :: Key -> URLString -> Annex Bool
perform' key url = do
setUrlPresent webUUID key url
r <- Remote.claimingUrl url
let url' = if Remote.uuid r == webUUID
then url
else setDownloader url OtherDownloader
setUrlPresent (Remote.uuid r) key url'
return True

1
debian/changelog vendored
View file

@ -10,6 +10,7 @@ git-annex (6.20160115) UNRELEASED; urgency=medium
* addurl --json: Include field for added key (unless the file was
added directly to git due to annex.largefiles configuration.)
(Also done by add --json and import --json)
* registerurl: Check if a remote claims the url, same as addurl does.
-- Joey Hess <id@joeyh.name> Fri, 15 Jan 2016 14:05:01 -0400