registerurl: Check if a remote claims the url, same as addurl does.
This commit is contained in:
parent
432151f966
commit
68edd308af
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue