annex.merge-annex-branches

Added annex.merge-annex-branches config setting which can be used to
disable automatic merge of git-annex branches.

I wonder if git-annex merge/sync/assistant should disable this
setting? Not sure yet, so have not done so. May be that users will not set
it in git config, but pass it via -c to commands that need it.

Checking the config setting adds a very small overhead, but it's
only checked once per command so should be insignificant.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2018-02-22 14:25:32 -04:00
parent addb91b24b
commit 09e73a3ab6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 59 additions and 6 deletions

View file

@ -140,7 +140,13 @@ forceUpdate = updateTo =<< siblingBranches
- Returns True if any refs were merged in, False otherwise.
-}
updateTo :: [(Git.Sha, Git.Branch)] -> Annex Bool
updateTo pairs = do
updateTo pairs = ifM (annexMergeAnnexBranches <$> Annex.getGitConfig)
( updateTo' pairs
, return False
)
updateTo' :: [(Git.Sha, Git.Branch)] -> Annex Bool
updateTo' pairs = do
-- ensure branch exists, and get its current ref
branchref <- getBranch
dirty <- journalDirty