summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Content.hs2
-rw-r--r--Annex/Init.hs12
2 files changed, 13 insertions, 1 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index 6e5131f77..c0c79ae56 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -377,7 +377,7 @@ sendAnnex key rollback sendobject = go =<< prepSendAnnex key
)
{- Returns a file that contains an object's content,
- - and an check to run after the transfer is complete.
+ - and a check to run after the transfer is complete.
-
- In direct mode, it's possible for the file to change as it's being sent,
- and the check detects this case and returns False.
diff --git a/Annex/Init.hs b/Annex/Init.hs
index 637b130ee..2f7b66fbc 100644
--- a/Annex/Init.hs
+++ b/Annex/Init.hs
@@ -23,8 +23,11 @@ import qualified Git.LsFiles
import qualified Git.Config
import qualified Git.Construct
import qualified Git.Types as Git
+import qualified Git.Objects
import qualified Annex.Branch
import Logs.UUID
+import Logs.Trust.Basic
+import Types.TrustLevel
import Annex.Version
import Annex.UUID
import Config
@@ -70,6 +73,7 @@ initialize mdescription = do
Annex.Branch.create
describeUUID u =<< genDescription mdescription
+-- Everything except for uuid setup.
initialize' :: Annex ()
initialize' = do
checkFifoSupport
@@ -87,6 +91,7 @@ initialize' = do
switchHEADBack
)
createInodeSentinalFile
+ checkSharedClone
uninitialize :: Annex ()
uninitialize = do
@@ -242,3 +247,10 @@ checkBadBare = allM (not <$>)
where
hasPreCommitHook = inRepo $ doesFileExist . hookFile preCommitHook
hasDotGitHEAD = inRepo $ \r -> doesFileExist $ Git.localGitDir r </> "HEAD"
+
+checkSharedClone :: Annex ()
+checkSharedClone = whenM (inRepo Git.Objects.isSharedClone) $ do
+ showSideAction "Repository was cloned with --shared; setting annex.hardlink=true and making repository untrusted."
+ u <- getUUID
+ trustSet u UnTrusted
+ setConfig (annexConfig "hardlink") (Git.Config.boolConfig True)