summaryrefslogtreecommitdiff
path: root/builtin/checkout-index.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-22 16:11:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-22 20:42:18 (GMT)
commit68e3d6292f27f123c072175748183c9cb9bc1c70 (patch)
tree3a3fcb89a074a31c3f0689c207f3390612b12379 /builtin/checkout-index.c
parent6fe1b1407ed91823daa5d487abe457ff37463349 (diff)
downloadgit-68e3d6292f27f123c072175748183c9cb9bc1c70.zip
git-68e3d6292f27f123c072175748183c9cb9bc1c70.tar.gz
git-68e3d6292f27f123c072175748183c9cb9bc1c70.tar.bz2
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>
Diffstat (limited to 'builtin/checkout-index.c')
-rw-r--r--builtin/checkout-index.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index 92c6967..30a49d9 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -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)
{