Skip to content

Commit 72c9793

Browse files
peffgitster
authored andcommitted
diff-lib: drop unused index argument from get_stat_data()
The "struct index_state" parameter passed to get_stat_data() has been unused since we stopped passing it to check_removed() in 6a044a2 (diff-lib: fix check_removed when fsmonitor is on, 2023-09-11). We can just drop it, which in turns lets us simplify our callers a bit. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 4d7de2c commit 72c9793

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

diff-lib.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,7 @@ static void diff_index_show_file(struct rev_info *revs,
308308
oid, oid_valid, ce->name, dirty_submodule);
309309
}
310310

311-
static int get_stat_data(const struct index_state *istate,
312-
const struct cache_entry *ce,
311+
static int get_stat_data(const struct cache_entry *ce,
313312
const struct object_id **oidp,
314313
unsigned int *modep,
315314
int cached, int match_missing,
@@ -352,7 +351,6 @@ static void show_new_file(struct rev_info *revs,
352351
const struct object_id *oid;
353352
unsigned int mode;
354353
unsigned dirty_submodule = 0;
355-
struct index_state *istate = revs->diffopt.repo->index;
356354

357355
if (new_file && S_ISSPARSEDIR(new_file->ce_mode)) {
358356
diff_tree_oid(NULL, &new_file->oid, new_file->name, &revs->diffopt);
@@ -363,7 +361,7 @@ static void show_new_file(struct rev_info *revs,
363361
* New file in the index: it might actually be different in
364362
* the working tree.
365363
*/
366-
if (get_stat_data(istate, new_file, &oid, &mode, cached, match_missing,
364+
if (get_stat_data(new_file, &oid, &mode, cached, match_missing,
367365
&dirty_submodule, &revs->diffopt) < 0)
368366
return;
369367

@@ -379,7 +377,6 @@ static int show_modified(struct rev_info *revs,
379377
unsigned int mode, oldmode;
380378
const struct object_id *oid;
381379
unsigned dirty_submodule = 0;
382-
struct index_state *istate = revs->diffopt.repo->index;
383380

384381
assert(S_ISSPARSEDIR(old_entry->ce_mode) ==
385382
S_ISSPARSEDIR(new_entry->ce_mode));
@@ -395,7 +392,7 @@ static int show_modified(struct rev_info *revs,
395392
return 0;
396393
}
397394

398-
if (get_stat_data(istate, new_entry, &oid, &mode, cached, match_missing,
395+
if (get_stat_data(new_entry, &oid, &mode, cached, match_missing,
399396
&dirty_submodule, &revs->diffopt) < 0) {
400397
if (report_missing)
401398
diff_index_show_file(revs, "-", old_entry,

0 commit comments

Comments
 (0)