send-pack: factor out capability string generation
commit887f3533fd764722ffb6e4ea34c01ad9256f0186
authorJunio C Hamano <gitster@pobox.com>
Fri, 15 Aug 2014 18:37:01 +0000 (15 11:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Sep 2014 20:23:19 +0000 (15 13:23 -0700)
treecb7084c019f7fc0036703328022e9dd89c27b991
parent64de20a1265b676f9cc0e5f46379a017560fa333
send-pack: factor out capability string generation

A run of 'var ? " var" : ""' fed to a long printf string in a deeply
nested block was hard to read.  Move it outside the loop and format
it into a strbuf.

As an added bonus, the trick to add "agent=<agent-name>" by using
two conditionals is replaced by a more readable version.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
send-pack.c