aboutsummaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2018-02-22 14:25:32 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2018-02-22 14:25:32 -0400
commite1e17f4267576b3dcbeac619b43bc4de2f1c00a5 (patch)
tree3c128ef381efe8a9133428146594128d0f2d770c /Annex
parent1e98283d31b2e291a9627ea5e025af4ba4cd63a4 (diff)
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.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Branch.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index 070f8ff98..36cfb8b55 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -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