diff options
author | René Scharfe <l.s.r@web.de> | 2016-09-22 18:11:33 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-22 13:42:18 -0700 |
commit | 68e3d6292f27f123c072175748183c9cb9bc1c70 (patch) | |
tree | 3a3fcb89a074a31c3f0689c207f3390612b12379 /apply.c | |
parent | 6fe1b1407ed91823daa5d487abe457ff37463349 (diff) | |
download | git-68e3d6292f27f123c072175748183c9cb9bc1c70.tar.gz |
introduce CHECKOUT_INITrs/checkout-init-macro
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 'apply.c')
-rw-r--r-- | apply.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -3334,10 +3334,8 @@ static void prepare_fn_table(struct apply_state *state, struct patch *patch) static int checkout_target(struct index_state *istate, struct cache_entry *ce, struct stat *st) { - struct checkout costate; + struct checkout costate = CHECKOUT_INIT; - memset(&costate, 0, sizeof(costate)); - costate.base_dir = ""; costate.refresh_cache = 1; costate.istate = istate; if (checkout_entry(ce, &costate, NULL) || lstat(ce->name, st)) |