]> git.ipfire.org Git - thirdparty/git.git/commit
log-tree: use decimal_width()
authorRené Scharfe <l.s.r@web.de>
Sat, 3 Aug 2024 12:33:24 +0000 (14:33 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Aug 2024 15:59:40 +0000 (08:59 -0700)
commit0c4d5aa22d65fb395962bdc0165840f66b7b91ea
treee89da1a1fe6a4eb884b77ef740c30b2e295536aa
parent337b4d400023d22207bcc3c29e9ebab31bf96fc2
log-tree: use decimal_width()

Reduce code duplication by calling decimal_width() to count the digits
in the number of commits instead of calculating it locally.

It also has the advantage of returning int, which is the exact type
expected by the printf()-like function strbuf_addf() for field width
arguments.

Additionally, decimal_width() supports numbers bigger than 1410065407,
which is (hopefully) just a theoretical advantage.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
log-tree.c