summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-22 18:11:33 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-22 13:42:18 -0700
commit68e3d6292f27f123c072175748183c9cb9bc1c70 (patch)
tree3a3fcb89a074a31c3f0689c207f3390612b12379 /unpack-trees.c
parent6fe1b1407ed91823daa5d487abe457ff37463349 (diff)
downloadgit-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 'unpack-trees.c')
-rw-r--r--unpack-trees.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 3db3f02577..ea6bdd20e0 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1094,12 +1094,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
int i, ret;
static struct cache_entry *dfc;
struct exclude_list el;
- struct checkout state;
+ struct checkout state = CHECKOUT_INIT;
if (len > MAX_UNPACK_TREES)
die("unpack_trees takes at most %d trees", MAX_UNPACK_TREES);
- memset(&state, 0, sizeof(state));
- state.base_dir = "";
state.force = 1;
state.quiet = 1;
state.refresh_cache = 1;