summaryrefslogtreecommitdiff
path: root/git-union-merge.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-21 19:52:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-21 20:12:53 -0400
commit7a693394f4acd05d1dedbaffec0762007a954d9e (patch)
tree6ceb79326b176b7b94531b44746a2eea0e9a39bd /git-union-merge.hs
parent5e0adb26375413aaeef7c41dd72e8761e3cc1ada (diff)
allow for union merges between a tree and the content in the index
This is needed for robust handling of the git-annex branch. Since changes are staged to its index as git-annex runs, and committed at the end, it's possible that git-annex is interrupted, and leaves a dirty index. When it next runs, it needs to be able to merge the git-annex branch as necessary, without losing the existing changes in the index. Note that this assumes that the git-annex branch is only modified by git-annex. Any changes to it will be lost when git-annex updates the branch. I don't see a good, inexpensive way to find changes in the git-annex branch that arn't in the index, and union merging the git-annex branch into the index every time would likewise be expensive.
Diffstat (limited to 'git-union-merge.hs')
-rw-r--r--git-union-merge.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-union-merge.hs b/git-union-merge.hs
index f02db6be3..7c0c1cd84 100644
--- a/git-union-merge.hs
+++ b/git-union-merge.hs
@@ -44,5 +44,6 @@ main = do
g <- Git.configRead =<< Git.repoFromCwd
Git.useIndex (tmpIndex g)
setup g
- GitUnionMerge.merge g aref bref newref False
+ GitUnionMerge.merge g [aref, bref]
+ GitUnionMerge.commit g "union merge" newref [aref, bref]
cleanup g