fmt-merge-msg: minor refactor of fmt_merge_msg()
Shift implementation into a private function, do_fmt_merge_msg(). This allows for further changes to the implementation, without affecting the interface. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tay Ray Chuan committed
May 11, 2010 at 01:17 UTC
2234ec5422201cd58f51b82fb4af146cf896767d
1 file changed
+6
-1
builtin/fmt-merge-msg.c
+6
-1
@@ -202,7 +202,8 @@ static void shortlog(const char *name, unsigned char *sha1,
202
string_list_clear(&subjects, 0);
203
}
204
205
-int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
205
+static int do_fmt_merge_msg(int merge_summary, struct strbuf *in,
206
+ struct strbuf *out) {
207
int limit = 20, i = 0, pos = 0;
208
char *sep = "";
209
unsigned char head_sha1[20];
@@ -296,6 +297,10 @@ int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
297
return 0;
298
}
299
300
+int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
301
+ return do_fmt_merge_msg(merge_summary, in, out);
302
+}
303
+
304
int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
305
{
306
const char *inpath = NULL;