create_branch: move msg setup closer to point of use
commit3818b258dc145aae25c48cf4fca830be0cb69c6e
authorJeff King <peff@peff.net>
Tue, 28 Mar 2017 19:46:36 +0000 (28 15:46 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Mar 2017 21:59:50 +0000 (30 14:59 -0700)
treee28436a6dd1946d7dab8a3c473e1a3da9b20e71b
parent6cd4a8982dbde0b6fee26faba2873c475af50a28
create_branch: move msg setup closer to point of use

In create_branch() we write the reflog msg into a buffer in
the main function, but then use it only inside a
conditional. If you carefully follow the logic, you can
confirm that we never use the buffer uninitialized nor write
when it would not be used. But we can make this a lot more
obvious by simply moving the write step inside the
conditional.

Signed-off-by: Jeff King <peff@peff.net>
branch.c