Subject: [PATCH 6/7] Export rerere() and launch_editor().

From: Kristian Høgsberg <[email-masked]>
Date: Mon, 17 Sep 2007 20:06:47 -0400

Signed-off-by: Kristian Høgsberg <[email-masked]>
---
 builtin-rerere.c |   16 ++++++++++++++++
 commit.h         |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/builtin-rerere.c b/builtin-rerere.c
index 826d346..54f3575 100644
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
@@ -395,6 +395,22 @@ static int is_rerere_enabled(void)
 	return 1;
 }
 
+/* Export for builtin-commit. */
+int rerere(void)
+{
+	struct path_list merge_rr = { NULL, 0, 0, 1 };
+	int fd;
+
+	git_config(git_rerere_config);
+	if (!is_rerere_enabled())
+		return 0;
+
+	merge_rr_path = xstrdup(git_path("rr-cache/MERGE_RR"));
+	fd = hold_lock_file_for_update(&write_lock, merge_rr_path, 1);
+	read_rr(&merge_rr);
+	return do_plain_rerere(&merge_rr, fd);
+}
+
 int cmd_rerere(int argc, const char **argv, const char *prefix)
 {
 	struct path_list merge_rr = { NULL, 0, 0, 1 };
diff --git a/commit.h b/commit.h
index da34c23..cc8d890 100644
--- a/commit.h
+++ b/commit.h
@@ -130,5 +130,6 @@ extern struct commit_list *get_shallow_commits(struct object_array *heads,
 int in_merge_bases(struct commit *, struct commit **, int);
 
 extern int interactive_add(void);
+extern int rerere(void);
 
 #endif /* COMMIT_H */
-- 
1.5.3.1.993.gbf388-dirty