summaryrefslogtreecommitdiff
path: root/merge-recursive.h
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2008-02-07 16:40:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-10 07:16:51 (GMT)
commite1b3a2cad79a8138d18593c6eb3c46906ad2ee42 (patch)
tree67706beab8903194e73acf4486665d59c15b7099 /merge-recursive.h
parent4e7c4571b8b31d6a09de2826361540caa76d3526 (diff)
downloadgit-e1b3a2cad79a8138d18593c6eb3c46906ad2ee42.zip
git-e1b3a2cad79a8138d18593c6eb3c46906ad2ee42.tar.gz
git-e1b3a2cad79a8138d18593c6eb3c46906ad2ee42.tar.bz2
Build-in merge-recursive
This makes write_tree_from_memory(), which writes the active cache as a tree and returns the struct tree for it, available to other code. It also makes available merge_trees(), which does the internal merge of two trees with a known base, and merge_recursive(), which does the recursive internal merge of two commits with a list of common ancestors. The first two of these will be used by checkout -m, and the third is presumably useful in general, although the implementation of checkout -m which entirely matches the behavior of the shell version does not use it (since it ignores the difference of ancestry between the old branch and the new branch). Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Diffstat (limited to 'merge-recursive.h')
-rw-r--r--merge-recursive.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/merge-recursive.h b/merge-recursive.h
new file mode 100644
index 0000000..f37630a
--- /dev/null
+++ b/merge-recursive.h
@@ -0,0 +1,20 @@
+#ifndef MERGE_RECURSIVE_H
+#define MERGE_RECURSIVE_H
+
+int merge_recursive(struct commit *h1,
+ struct commit *h2,
+ const char *branch1,
+ const char *branch2,
+ struct commit_list *ancestors,
+ struct commit **result);
+
+int merge_trees(struct tree *head,
+ struct tree *merge,
+ struct tree *common,
+ const char *branch1,
+ const char *branch2,
+ struct tree **result);
+
+struct tree *write_tree_from_memory(void);
+
+#endif