Commit 9f98de9c4993b8b5ae95cedf9b1d916f6618a887

Stefan Sperling 2019-02-08T12:09:28

declare got_merge_diff3()

diff --git a/lib/diff3.c b/lib/diff3.c
index 3132fbc..d0a238e 100644
--- a/lib/diff3.c
+++ b/lib/diff3.c
@@ -89,10 +89,6 @@
 #define nitems(_a) (sizeof(_a) / sizeof((_a)[0]))
 #endif
 
-/* flags shared between merge(1) and rcsmerge(1) */
-#define MERGE_EFLAG     (1<<16)
-#define MERGE_OFLAG     (1<<17)
-
 /* diff3 - 3-way differential file comparison */
 
 /* diff3 [-ex3EX] d13 d23 f1 f2 f3 [m1 m3]
@@ -265,7 +261,7 @@ done:
  * For merge(1).
  */
 const struct got_error *
-merge_diff3(int outfd, char *p1, char *p2, char *p3, int flags)
+got_merge_diff3(int outfd, const char *p1, const char *p2, const char *p3)
 {
 	const struct got_error *err = NULL;
 	char *dp13, *dp23, *path1, *path2, *path3;
@@ -286,9 +282,6 @@ merge_diff3(int outfd, char *p1, char *p2, char *p3, int flags)
 	dp13 = dp23 = path1 = path2 = path3 = NULL;
 	data = patch = NULL;
 
-	if ((flags & MERGE_EFLAG) && !(flags & MERGE_OFLAG))
-		d3s->oflag = 0;
-
 	if ((b1 = buf_load(p1)) == NULL)
 		goto out;
 	if ((b2 = buf_load(p2)) == NULL)
diff --git a/lib/got_lib_diff.h b/lib/got_lib_diff.h
index edd8672..cb4b545 100644
--- a/lib/got_lib_diff.h
+++ b/lib/got_lib_diff.h
@@ -139,3 +139,6 @@ const struct got_error *got_diffreg(int *, FILE *,
 const struct got_error *got_diff_blob_lines_changed(struct got_diff_changes **,
     struct got_blob_object *, struct got_blob_object *);
 void got_diff_free_changes(struct got_diff_changes *);
+
+const struct got_error *got_merge_diff3(int, const char *, const char *,
+    const char *);