diff: use the word "path" instead of "name" for blobs
The stuff_change() function makes diff_filespecs out of blobs. The term we generally use for filespecs is "path", not "name", so let's be consistent here. That will make things less confusing when the next patch starts caring about the path/name distinction inside the pending object array. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
May 19, 2017 at 08:58 UTC
d04ec74b17138733463c0ca1024fdbb42be6096a
1 file changed
+7
-7
builtin/diff.c
+7
-7
@@ -29,8 +29,8 @@ static void stuff_change(struct diff_options *opt,
29
const struct object_id *new_oid,
30
int old_oid_valid,
31
int new_oid_valid,
32
- const char *old_name,
33
- const char *new_name)
32
+ const char *old_path,
33
+ const char *new_path)
34
{
35
struct diff_filespec *one, *two;
36
@@ -41,16 +41,16 @@ static void stuff_change(struct diff_options *opt,
41
if (DIFF_OPT_TST(opt, REVERSE_DIFF)) {
42
SWAP(old_mode, new_mode);
43
SWAP(old_oid, new_oid);
44
- SWAP(old_name, new_name);
44
+ SWAP(old_path, new_path);
45
}
46
47
if (opt->prefix &&
48
- (strncmp(old_name, opt->prefix, opt->prefix_length) ||
49
- strncmp(new_name, opt->prefix, opt->prefix_length)))
48
+ (strncmp(old_path, opt->prefix, opt->prefix_length) ||
49
+ strncmp(new_path, opt->prefix, opt->prefix_length)))
50
return;
51
52
- one = alloc_filespec(old_name);
53
- two = alloc_filespec(new_name);
52
+ one = alloc_filespec(old_path);
53
+ two = alloc_filespec(new_path);
54
fill_filespec(one, old_oid->hash, old_oid_valid, old_mode);
55
fill_filespec(two, new_oid->hash, new_oid_valid, new_mode);
56