From 667617a1f2c39f338cbbcb7cab861472b5d7e438 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 13 Dec 2017 14:34:32 -0400 Subject: .noannex file A top-level .noannex file will prevent git-annex init from being used in a repository. This is useful for repositories that have a policy reason not to use git-annex. The content of the file will be displayed to the user who tries to run git-annex init. This also affects git annex reinit and initialization via the webapp. It does not affect automatic inits, when there's a sibling git-annex branch already. This commit was supported by the NSF-funded DataLad project. --- Command/ConfigList.hs | 2 +- Command/Init.hs | 2 +- Command/Reinit.hs | 2 +- Command/Upgrade.hs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Command') diff --git a/Command/ConfigList.hs b/Command/ConfigList.hs index 383117e52..9fa4e5a44 100644 --- a/Command/ConfigList.hs +++ b/Command/ConfigList.hs @@ -45,7 +45,7 @@ findOrGenUUID = do else ifM (Annex.Branch.hasSibling <||> (isJust <$> Fields.getField Fields.autoInit)) ( do liftIO checkNotReadOnly - initialize Nothing Nothing + initialize (AutoInit True) Nothing Nothing getUUID , return NoUUID ) diff --git a/Command/Init.hs b/Command/Init.hs index e7f57c29c..8ce82a75e 100644 --- a/Command/Init.hs +++ b/Command/Init.hs @@ -45,7 +45,7 @@ start os = do perform :: InitOptions -> CommandPerform perform os = do - initialize + initialize (AutoInit False) (if null (initDesc os) then Nothing else Just (initDesc os)) (initVersion os) Annex.SpecialRemote.autoEnable diff --git a/Command/Reinit.hs b/Command/Reinit.hs index 6defa4e95..d47e83573 100644 --- a/Command/Reinit.hs +++ b/Command/Reinit.hs @@ -36,6 +36,6 @@ perform s = do then return $ toUUID s else Remote.nameToUUID s storeUUID u - initialize' Nothing + initialize' (AutoInit False) Nothing Annex.SpecialRemote.autoEnable next $ return True diff --git a/Command/Upgrade.hs b/Command/Upgrade.hs index 1c3e62695..ab245c29e 100644 --- a/Command/Upgrade.hs +++ b/Command/Upgrade.hs @@ -25,6 +25,6 @@ start :: CommandStart start = do showStart' "upgrade" Nothing whenM (isNothing <$> getVersion) $ do - initialize Nothing Nothing + initialize (AutoInit False) Nothing Nothing r <- upgrade False latestVersion next $ next $ return r -- cgit v1.2.3