introduce CHECKOUT_INIT

Add a static initializer for struct checkout and use it throughout the
code base.  It's shorter, avoids a memset(3) call and makes sure the
base_dir member is initialized to a valid (empty) string.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2016-09-22 18:11:33 +02:00
committed by Junio C Hamano
parent 6fe1b1407e
commit 68e3d6292f
5 changed files with 5 additions and 9 deletions

View File

@ -16,7 +16,7 @@ static int checkout_stage; /* default to checkout stage0 */
static int to_tempfile;
static char topath[4][TEMPORARY_FILENAME_LENGTH + 1];
static struct checkout state;
static struct checkout state = CHECKOUT_INIT;
static void write_tempfile_record(const char *name, const char *prefix)
{