builtin/describe.c: factor out describe_commit
commit4dbc59a4cce418ff8428a9d2ecd67c34ca50db56
authorStefan Beller <sbeller@google.com>
Thu, 16 Nov 2017 02:00:38 +0000 (15 18:00 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Nov 2017 02:12:51 +0000 (16 11:12 +0900)
tree5e8c2f450d9c8c705838cb47d33753c832bf3db8
parentcdaed0cf023a47cae327671fae11c10d88100ee7
builtin/describe.c: factor out describe_commit

Factor out describing commits into its own function `describe_commit`,
which will put any output to stdout into a strbuf, to be printed
afterwards.

As the next patch will teach Git to describe blobs using a commit and path,
this refactor will make it easy to reuse the code describing commits.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/describe.c