| 349 | } |
| 350 | |
| 351 | static void show_new_file(struct rev_info *revs, |
| 352 | const struct cache_entry *new_file, |
| 353 | int cached, int match_missing) |
| 354 | { |
| 355 | const struct object_id *oid; |
| 356 | unsigned int mode; |
| 357 | unsigned dirty_submodule = 0; |
| 358 | |
| 359 | if (new_file && S_ISSPARSEDIR(new_file->ce_mode)) { |
| 360 | diff_tree_oid(NULL, &new_file->oid, new_file->name, &revs->diffopt); |
| 361 | return; |
| 362 | } |
| 363 | |
| 364 | /* |
| 365 | * New file in the index: it might actually be different in |
| 366 | * the working tree. |
| 367 | */ |
| 368 | if (get_stat_data(new_file, &oid, &mode, cached, match_missing, |
| 369 | &dirty_submodule, &revs->diffopt) < 0) |
| 370 | return; |
| 371 | |
| 372 | diff_index_show_file(revs, "+", new_file, oid, !is_null_oid(oid), mode, dirty_submodule); |
| 373 | } |
| 374 | |
| 375 | static int show_modified(struct rev_info *revs, |
| 376 | const struct cache_entry *old_entry, |
no test coverage detected