@@ -452,8 +452,9 @@ static int same(struct cache_entry *a, struct cache_entry *b)
452
452
* When a CE gets turned into an unmerged entry, we
453
453
* want it to be up-to-date
454
454
*/
455
- static int verify_uptodate (struct cache_entry * ce ,
456
- struct unpack_trees_options * o )
455
+ static int verify_uptodate_1 (struct cache_entry * ce ,
456
+ struct unpack_trees_options * o ,
457
+ const char * error_msg )
457
458
{
458
459
struct stat st ;
459
460
@@ -478,7 +479,13 @@ static int verify_uptodate(struct cache_entry *ce,
478
479
if (errno == ENOENT )
479
480
return 0 ;
480
481
return o -> gently ? -1 :
481
- error (ERRORMSG (o , not_uptodate_file ), ce -> name );
482
+ error (error_msg , ce -> name );
483
+ }
484
+
485
+ static int verify_uptodate (struct cache_entry * ce ,
486
+ struct unpack_trees_options * o )
487
+ {
488
+ return verify_uptodate_1 (ce , o , ERRORMSG (o , not_uptodate_file ));
482
489
}
483
490
484
491
static void invalidate_ce_path (struct cache_entry * ce , struct unpack_trees_options * o )
@@ -586,8 +593,9 @@ static int icase_exists(struct unpack_trees_options *o, struct cache_entry *dst,
586
593
* We do not want to remove or overwrite a working tree file that
587
594
* is not tracked, unless it is ignored.
588
595
*/
589
- static int verify_absent (struct cache_entry * ce , const char * action ,
590
- struct unpack_trees_options * o )
596
+ static int verify_absent_1 (struct cache_entry * ce , const char * action ,
597
+ struct unpack_trees_options * o ,
598
+ const char * error_msg )
591
599
{
592
600
struct stat st ;
593
601
@@ -667,6 +675,11 @@ static int verify_absent(struct cache_entry *ce, const char *action,
667
675
}
668
676
return 0 ;
669
677
}
678
+ static int verify_absent (struct cache_entry * ce , const char * action ,
679
+ struct unpack_trees_options * o )
680
+ {
681
+ return verify_absent_1 (ce , action , o , ERRORMSG (o , would_lose_untracked ));
682
+ }
670
683
671
684
static int merged_entry (struct cache_entry * merge , struct cache_entry * old ,
672
685
struct unpack_trees_options * o )
0 commit comments