]> git.ipfire.org Git - thirdparty/git.git/commit - merge-recursive.c
merge-recursive: convert malloc / strcpy to strbuf
authorJeff King <peff@peff.net>
Thu, 24 Sep 2015 21:07:43 +0000 (17:07 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Oct 2015 18:08:04 +0000 (11:08 -0700)
commitb4600fbe071898068ef30be2766ee75880ec308b
treeee50a70d3f17743800de7bd4726cb917029a01fb
parentbd22d4ffbc10052fef1a6c52aec066ee64236340
merge-recursive: convert malloc / strcpy to strbuf

This would be a fairly routine use of xstrfmt, except that
we need to remember the length of the result to pass to
cache_name_pos. So just use a strbuf, which makes this
simple.

As a bonus, this gets rid of confusing references to
"pathlen+1". The "1" is for the trailing slash we added, but
that is automatically accounted for in the strbuf's len
parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c