Move git_merge_base() to is own header and document it
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
diff --git a/include/git2.h b/include/git2.h
index 7d053c4..d753873 100644
--- a/include/git2.h
+++ b/include/git2.h
@@ -22,6 +22,7 @@
#include "git2/repository.h"
#include "git2/revwalk.h"
+#include "git2/merge.h"
#include "git2/refs.h"
#include "git2/reflog.h"
diff --git a/include/git2/merge.h b/include/git2/merge.h
new file mode 100644
index 0000000..5a0b2e7
--- /dev/null
+++ b/include/git2/merge.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2009-2012 the libgit2 contributors
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+#ifndef INCLUDE_git_merge_h__
+#define INCLUDE_git_merge_h__
+
+#include "common.h"
+#include "types.h"
+#include "oid.h"
+
+/**
+ * @file git2/merge.h
+ * @brief Git merge-base routines
+ * @defgroup git_revwalk Git merge-base routines
+ * @ingroup Git
+ * @{
+ */
+GIT_BEGIN_DECL
+
+/**
+ * Find a merge base between two commits
+ *
+ * @param out the OID of a merge base between 'one' and 'two'
+ * @param repo the repository where the commits exist
+ * @param one one of the commits
+ * @param two the other commit
+ */
+GIT_EXTERN(int) git_merge_base(git_oid *out, git_repository *repo, git_oid *one, git_oid *two);
+
+/** @} */
+GIT_END_DECL
+#endif
diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h
index db27c62..632c675 100644
--- a/include/git2/revwalk.h
+++ b/include/git2/revwalk.h
@@ -232,9 +232,6 @@ GIT_EXTERN(void) git_revwalk_free(git_revwalk *walk);
*/
GIT_EXTERN(git_repository *) git_revwalk_repository(git_revwalk *walk);
-GIT_EXTERN(int) git_merge_base(git_oid *out, git_repository *repo, git_oid *one, git_oid *two);
-
-
/** @} */
GIT_END_DECL
#endif
diff --git a/src/revwalk.c b/src/revwalk.c
index f5fdc49..ac0414b 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -12,6 +12,7 @@
#include "pqueue.h"
#include "git2/revwalk.h"
+#include "git2/merge.h"
#include <regex.h>