summaryrefslogtreecommitdiff
path: root/Annex/AdjustedBranch.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-03-29 13:52:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-03-29 13:54:42 -0400
commitd3eac61d33603ef2896be9e4b20217e63505a4d6 (patch)
treeb97d6480e05ee7d4dc22ea595d1309d227ac5729 /Annex/AdjustedBranch.hs
parent2c2a41bce93797f348604fd11fdbd77fe12eaa9c (diff)
init: Automatically enter the adjusted unlocked branch when in a v6 repo on a filesystem not supporting symlinks.
Diffstat (limited to 'Annex/AdjustedBranch.hs')
-rw-r--r--Annex/AdjustedBranch.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/Annex/AdjustedBranch.hs b/Annex/AdjustedBranch.hs
index b2ca7dbf6..8b4712db1 100644
--- a/Annex/AdjustedBranch.hs
+++ b/Annex/AdjustedBranch.hs
@@ -14,6 +14,7 @@ module Annex.AdjustedBranch (
fromAdjustedBranch,
getAdjustment,
enterAdjustedBranch,
+ adjustToCrippledFileSystem,
updateAdjustedBranch,
propigateAdjustedCommits,
) where
@@ -151,6 +152,18 @@ enterAdjustedBranch adj = go =<< originalBranch
]
go Nothing = error "not on any branch!"
+adjustToCrippledFileSystem :: Annex ()
+adjustToCrippledFileSystem = do
+ warning "Entering an adjusted branch where files are unlocked as this filesystem does not support locked files."
+ whenM (isNothing <$> originalBranch) $
+ void $ inRepo $ Git.Branch.commitCommand Git.Branch.AutomaticCommit
+ [ Param "--quiet"
+ , Param "--allow-empty"
+ , Param "-m"
+ , Param "commit before entering adjusted unlocked branch"
+ ]
+ enterAdjustedBranch UnlockAdjustment
+
adjustBranch :: Adjustment -> OrigBranch -> Annex AdjBranch
adjustBranch adj origbranch = do
sha <- adjust adj origbranch