MCPcopy Create free account
hub / github.com/git/git / show_new_file

Function show_new_file

diff-lib.c:351–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351static 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
375static int show_modified(struct rev_info *revs,
376 const struct cache_entry *old_entry,

Callers 1

do_oneway_diffFunction · 0.85

Calls 4

diff_tree_oidFunction · 0.85
get_stat_dataFunction · 0.85
diff_index_show_fileFunction · 0.85
is_null_oidFunction · 0.85

Tested by

no test coverage detected