@@ -70,7 +70,7 @@ static int match_stat_with_submodule(struct diff_options *diffopt,
70
70
struct stat * st , unsigned ce_option ,
71
71
unsigned * dirty_submodule )
72
72
{
73
- int changed = ce_match_stat ( ce , st , ce_option );
73
+ int changed = ie_match_stat ( diffopt -> repo -> index , ce , st , ce_option );
74
74
if (S_ISGITLINK (ce -> ce_mode )) {
75
75
struct diff_flags orig_flags = diffopt -> flags ;
76
76
if (!diffopt -> flags .override_submodule_config )
@@ -93,23 +93,24 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
93
93
unsigned ce_option = ((option & DIFF_RACY_IS_MODIFIED )
94
94
? CE_MATCH_RACY_IS_DIRTY : 0 );
95
95
uint64_t start = getnanotime ();
96
+ struct index_state * istate = revs -> diffopt .repo -> index ;
96
97
97
98
diff_set_mnemonic_prefix (& revs -> diffopt , "i/" , "w/" );
98
99
99
100
if (diff_unmerged_stage < 0 )
100
101
diff_unmerged_stage = 2 ;
101
- entries = active_nr ;
102
+ entries = istate -> cache_nr ;
102
103
for (i = 0 ; i < entries ; i ++ ) {
103
104
unsigned int oldmode , newmode ;
104
- struct cache_entry * ce = active_cache [i ];
105
+ struct cache_entry * ce = istate -> cache [i ];
105
106
int changed ;
106
107
unsigned dirty_submodule = 0 ;
107
108
const struct object_id * old_oid , * new_oid ;
108
109
109
110
if (diff_can_quit_early (& revs -> diffopt ))
110
111
break ;
111
112
112
- if (!ce_path_match (& the_index , ce , & revs -> prune_data , NULL ))
113
+ if (!ce_path_match (istate , ce , & revs -> prune_data , NULL ))
113
114
continue ;
114
115
115
116
if (ce_stage (ce )) {
@@ -145,7 +146,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
145
146
dpath -> mode = wt_mode ;
146
147
147
148
while (i < entries ) {
148
- struct cache_entry * nce = active_cache [i ];
149
+ struct cache_entry * nce = istate -> cache [i ];
149
150
int stage ;
150
151
151
152
if (strcmp (ce -> name , nce -> name ))
@@ -474,7 +475,9 @@ static int oneway_diff(const struct cache_entry * const *src,
474
475
if (tree == o -> df_conflict_entry )
475
476
tree = NULL ;
476
477
477
- if (ce_path_match (& the_index , idx ? idx : tree , & revs -> prune_data , NULL )) {
478
+ if (ce_path_match (revs -> diffopt .repo -> index ,
479
+ idx ? idx : tree ,
480
+ & revs -> prune_data , NULL )) {
478
481
do_oneway_diff (o , idx , tree );
479
482
if (diff_can_quit_early (& revs -> diffopt )) {
480
483
o -> exiting_early = 1 ;
@@ -506,7 +509,7 @@ static int diff_cache(struct rev_info *revs,
506
509
opts .merge = 1 ;
507
510
opts .fn = oneway_diff ;
508
511
opts .unpack_data = revs ;
509
- opts .src_index = & the_index ;
512
+ opts .src_index = revs -> diffopt . repo -> index ;
510
513
opts .dst_index = NULL ;
511
514
opts .pathspec = & revs -> diffopt .pathspec ;
512
515
opts .pathspec -> recursive = 1 ;
0 commit comments