Skip to content

Commit 2234ec5

Browse files
rctaygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 97d45bc commit 2234ec5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

builtin/fmt-merge-msg.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ static void shortlog(const char *name, unsigned char *sha1,
202202
string_list_clear(&subjects, 0);
203203
}
204204

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) {
206207
int limit = 20, i = 0, pos = 0;
207208
char *sep = "";
208209
unsigned char head_sha1[20];
@@ -296,6 +297,10 @@ int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
296297
return 0;
297298
}
298299

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+
299304
int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
300305
{
301306
const char *inpath = NULL;

0 commit comments

Comments
 (0)