init: Automatically enter the adjusted unlocked branch when in a v6 repo on a filesystem not supporting symlinks.

This commit is contained in:
Joey Hess 2016-03-29 13:52:13 -04:00
parent bcd2350fc7
commit 8a69298bf2
Failed to extract signature
5 changed files with 24 additions and 10 deletions

View file

@ -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