diff.c: refactor pprint_rename() to use strbuf
commitc905cbc49c6455cc8d7c38c24a047396286f0fe6
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 1 Feb 2018 13:02:20 +0000 (1 20:02 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Feb 2018 20:05:27 +0000 (2 12:05 -0800)
treeca5e04820b567479c5b8f72db8e606a5594b9659
parent2512f15446149235156528dafbe75930c712b29e
diff.c: refactor pprint_rename() to use strbuf

Instead of passing char* around, let function handle strbuf
directly. All callers already use strbuf internally.

This helps kill the "not free" exception in free_diffstat_info(). I
don't think this code is so critical that we need to avoid some free()
calls.

The other benefit comes in the next patch, where we append something
in pname before returning from fill_print_name(). With strbuf, it's
very simple. With "char *" we may have to resort to explicit
reallocation and stuff.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c