update warnExportImportConflict for import-only remotes

This commit is contained in:
Joey Hess 2020-12-17 16:25:46 -04:00
parent 77aedbef8b
commit 400bdb48db
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -43,10 +43,15 @@ exportKey sha = mk <$> catKey sha
warnExportImportConflict :: Remote -> Annex () warnExportImportConflict :: Remote -> Annex ()
warnExportImportConflict r = do warnExportImportConflict r = do
ops <- Remote.isImportSupported r >>= return . \case isimport <- Remote.isImportSupported r
True -> "exported to and/or imported from" isexport <- Remote.isExportSupported r
False -> "exported to" let (ops, resolvcmd) = case (isexport, isimport) of
toplevelWarning True $ (False, True) -> ("imported from", "git-annex import")
"Conflict detected. Different trees have been " ++ ops ++ " " ++ (True, False) -> ("exported to", "git-annex export")
Remote.name r ++ _ -> ("exported to and/or imported from", "git-annex export")
". Use git-annex export to resolve this conflict." toplevelWarning True $ unwords
[ "Conflict detected. Different trees have been"
, ops, Remote.name r ++ ". Use"
, resolvcmd
, "to resolve this conflict."
]