@@ -218,8 +218,8 @@ static void unlink_entry(const struct cache_entry *ce)
218218 schedule_dir_for_removal (ce -> name , ce_namelen (ce ));
219219}
220220
221- static struct checkout state ;
222- static int check_updates ( struct unpack_trees_options * o )
221+ static int check_updates ( struct unpack_trees_options * o ,
222+ const struct checkout * state )
223223{
224224 unsigned cnt = 0 , total = 0 ;
225225 struct progress * progress = NULL ;
@@ -264,7 +264,7 @@ static int check_updates(struct unpack_trees_options *o)
264264 display_progress (progress , ++ cnt );
265265 ce -> ce_flags &= ~CE_UPDATE ;
266266 if (o -> update && !o -> dry_run ) {
267- errs |= checkout_entry (ce , & state , NULL );
267+ errs |= checkout_entry (ce , state , NULL );
268268 }
269269 }
270270 }
@@ -1094,6 +1094,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
10941094 int i , ret ;
10951095 static struct cache_entry * dfc ;
10961096 struct exclude_list el ;
1097+ struct checkout state ;
10971098
10981099 if (len > MAX_UNPACK_TREES )
10991100 die ("unpack_trees takes at most %d trees" , MAX_UNPACK_TREES );
@@ -1239,7 +1240,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
12391240 }
12401241
12411242 o -> src_index = NULL ;
1242- ret = check_updates (o ) ? (-2 ) : 0 ;
1243+ ret = check_updates (o , & state ) ? (-2 ) : 0 ;
12431244 if (o -> dst_index ) {
12441245 if (!ret ) {
12451246 if (!o -> result .cache_tree )
0 commit comments