read-cache: make sure file handles are not inherited by child processes
[gitweb.git] / apply.c
diff --git a/apply.c b/apply.c
index e32702153c787747ba423fbe60697ab2ce4db3a3..b03d274b522b87e8666bc3703bf0c5f1c9fc9e5b 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -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))