From 47b1e890e3f7ba57e8c5bc364dcb04d8b2dc1c58 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Tue, 27 Oct 2020 02:08:08 +0000 Subject: merge-ort-wrappers: new convience wrappers to mimic the old merge API There are a few differences between the new API in merge-ort and the old API in merge-recursive. While the new API is more flexible, it might feel like more work at times than the old API. merge-ort-wrappers creates two convenience wrappers taking the exact same arguments as the old merge_trees() and merge_recursive() functions and implements them via the new API. This makes converting existing callsites easier, and serves to highlight some of the differences in the API. Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- merge-ort-wrappers.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 merge-ort-wrappers.h (limited to 'merge-ort-wrappers.h') diff --git a/merge-ort-wrappers.h b/merge-ort-wrappers.h new file mode 100644 index 0000000000..0c4c57adbb --- /dev/null +++ b/merge-ort-wrappers.h @@ -0,0 +1,25 @@ +#ifndef MERGE_ORT_WRAPPERS_H +#define MERGE_ORT_WRAPPERS_H + +#include "merge-recursive.h" + +/* + * rename-detecting three-way merge, no recursion. + * Wrapper mimicking the old merge_trees() function. + */ +int merge_ort_nonrecursive(struct merge_options *opt, + struct tree *head, + struct tree *merge, + struct tree *common); + +/* + * rename-detecting three-way merge with recursive ancestor consolidation. + * Wrapper mimicking the old merge_recursive() function. + */ +int merge_ort_recursive(struct merge_options *opt, + struct commit *h1, + struct commit *h2, + struct commit_list *ancestors, + struct commit **result); + +#endif -- cgit v1.2.3