| 313 | } |
| 314 | |
| 315 | static int get_stat_data(const struct cache_entry *ce, |
| 316 | const struct object_id **oidp, |
| 317 | unsigned int *modep, |
| 318 | int cached, int match_missing, |
| 319 | unsigned *dirty_submodule, struct diff_options *diffopt) |
| 320 | { |
| 321 | const struct object_id *oid = &ce->oid; |
| 322 | unsigned int mode = ce->ce_mode; |
| 323 | |
| 324 | if (!cached && !ce_uptodate(ce)) { |
| 325 | int changed; |
| 326 | struct stat st; |
| 327 | changed = check_removed(ce, &st); |
| 328 | if (changed < 0) |
| 329 | return -1; |
| 330 | else if (changed) { |
| 331 | if (match_missing) { |
| 332 | *oidp = oid; |
| 333 | *modep = mode; |
| 334 | return 0; |
| 335 | } |
| 336 | return -1; |
| 337 | } |
| 338 | changed = match_stat_with_submodule(diffopt, ce, &st, |
| 339 | 0, dirty_submodule); |
| 340 | if (changed) { |
| 341 | mode = ce_mode_from_stat(ce, st.st_mode); |
| 342 | oid = null_oid(the_hash_algo); |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | *oidp = oid; |
| 347 | *modep = mode; |
| 348 | return 0; |
| 349 | } |
| 350 | |
| 351 | static void show_new_file(struct rev_info *revs, |
| 352 | const struct cache_entry *new_file, |
no test coverage detected