Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-22 19:11:33 +0300
committerJunio C Hamano <gitster@pobox.com>2016-09-22 23:42:18 +0300
commit68e3d6292f27f123c072175748183c9cb9bc1c70 (patch)
tree3a3fcb89a074a31c3f0689c207f3390612b12379 /unpack-trees.c
parent6fe1b1407ed91823daa5d487abe457ff37463349 (diff)
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 '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;