@@ -365,17 +365,14 @@ static int merge_working_tree(struct checkout_opts *opts,
365365 int ret ;
366366 struct lock_file * lock_file = xcalloc (1 , sizeof (struct lock_file ));
367367 int newfd = hold_locked_index (lock_file , 1 );
368- int reprime_cache_tree = 0 ;
369368
370369 if (read_cache () < 0 )
371370 return error ("corrupt index file" );
372371
373- cache_tree_free (& active_cache_tree );
374372 if (opts -> force ) {
375373 ret = reset_tree (new -> commit -> tree , opts , 1 );
376374 if (ret )
377375 return ret ;
378- reprime_cache_tree = 1 ;
379376 } else {
380377 struct tree_desc trees [2 ];
381378 struct tree * tree ;
@@ -411,9 +408,7 @@ static int merge_working_tree(struct checkout_opts *opts,
411408 init_tree_desc (& trees [1 ], tree -> buffer , tree -> size );
412409
413410 ret = unpack_trees (2 , trees , & topts );
414- if (ret != -1 ) {
415- reprime_cache_tree = 1 ;
416- } else {
411+ if (ret == -1 ) {
417412 /*
418413 * Unpack couldn't do a trivial merge; either
419414 * give up or do a real merge, depending on
@@ -457,8 +452,6 @@ static int merge_working_tree(struct checkout_opts *opts,
457452 }
458453 }
459454
460- if (reprime_cache_tree )
461- prime_cache_tree (& active_cache_tree , new -> commit -> tree );
462455 if (write_cache (newfd , active_cache , active_nr ) ||
463456 commit_locked_index (lock_file ))
464457 die ("unable to write new index file" );
0 commit comments