MCPcopy Index your code
hub / github.com/git/git / diff_queue_change

Function diff_queue_change

diff.c:7650–7699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7648}
7649
7650struct diff_filepair *diff_queue_change(struct diff_queue_struct *queue,
7651 struct diff_options *options,
7652 unsigned old_mode, unsigned new_mode,
7653 const struct object_id *old_oid,
7654 const struct object_id *new_oid,
7655 int old_oid_valid, int new_oid_valid,
7656 const char *concatpath,
7657 unsigned old_dirty_submodule,
7658 unsigned new_dirty_submodule)
7659{
7660 struct diff_filespec *one, *two;
7661 struct diff_filepair *p;
7662
7663 if (S_ISGITLINK(old_mode) && S_ISGITLINK(new_mode) &&
7664 is_submodule_ignored(concatpath, options))
7665 return NULL;
7666
7667 if (options->flags.reverse_diff) {
7668 SWAP(old_mode, new_mode);
7669 SWAP(old_oid, new_oid);
7670 SWAP(old_oid_valid, new_oid_valid);
7671 SWAP(old_dirty_submodule, new_dirty_submodule);
7672 }
7673
7674 if (options->prefix &&
7675 strncmp(concatpath, options->prefix, options->prefix_length))
7676 return NULL;
7677
7678 one = alloc_filespec(concatpath);
7679 two = alloc_filespec(concatpath);
7680 fill_filespec(one, old_oid, old_oid_valid, old_mode);
7681 fill_filespec(two, new_oid, new_oid_valid, new_mode);
7682 one->dirty_submodule = old_dirty_submodule;
7683 two->dirty_submodule = new_dirty_submodule;
7684 p = diff_queue(queue, one, two);
7685
7686 if (options->flags.diff_from_contents)
7687 return p;
7688
7689 if (options->flags.quick && options->skip_stat_unmatch &&
7690 !diff_filespec_check_stat_unmatch(options->repo, p)) {
7691 diff_free_filespec_data(p->one);
7692 diff_free_filespec_data(p->two);
7693 return p;
7694 }
7695
7696 options->flags.has_changes = 1;
7697
7698 return p;
7699}
7700
7701void diff_addremove(struct diff_options *options, int addremove, unsigned mode,
7702 const struct object_id *oid, int oid_valid,

Callers 2

diff_changeFunction · 0.85
cmd_diff_pairsFunction · 0.85

Calls 6

is_submodule_ignoredFunction · 0.85
alloc_filespecFunction · 0.85
fill_filespecFunction · 0.85
diff_queueFunction · 0.85
diff_free_filespec_dataFunction · 0.85

Tested by

no test coverage detected