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

Function stuff_change

builtin/diff.c:47–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47static void stuff_change(struct diff_options *opt,
48 unsigned old_mode, unsigned new_mode,
49 const struct object_id *old_oid,
50 const struct object_id *new_oid,
51 int old_oid_valid,
52 int new_oid_valid,
53 const char *old_path,
54 const char *new_path)
55{
56 struct diff_filespec *one, *two;
57
58 if (!is_null_oid(old_oid) && !is_null_oid(new_oid) &&
59 oideq(old_oid, new_oid) && (old_mode == new_mode))
60 return;
61
62 if (opt->flags.reverse_diff) {
63 SWAP(old_mode, new_mode);
64 SWAP(old_oid, new_oid);
65 SWAP(old_path, new_path);
66 }
67
68 if (opt->prefix &&
69 (strncmp(old_path, opt->prefix, opt->prefix_length) ||
70 strncmp(new_path, opt->prefix, opt->prefix_length)))
71 return;
72
73 one = alloc_filespec(old_path);
74 two = alloc_filespec(new_path);
75 fill_filespec(one, old_oid, old_oid_valid, old_mode);
76 fill_filespec(two, new_oid, new_oid_valid, new_mode);
77
78 diff_queue(&diff_queued_diff, one, two);
79}
80
81static void builtin_diff_b_f(struct rev_info *revs,
82 int argc, const char **argv UNUSED,

Callers 2

builtin_diff_b_fFunction · 0.85
builtin_diff_blobsFunction · 0.85

Calls 5

is_null_oidFunction · 0.85
oideqFunction · 0.85
alloc_filespecFunction · 0.85
fill_filespecFunction · 0.85
diff_queueFunction · 0.85

Tested by

no test coverage detected