Skip to content

Commit d04ec74

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 42f5ba5 commit d04ec74

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

builtin/diff.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ static void stuff_change(struct diff_options *opt,
2929
const struct object_id *new_oid,
3030
int old_oid_valid,
3131
int new_oid_valid,
32-
const char *old_name,
33-
const char *new_name)
32+
const char *old_path,
33+
const char *new_path)
3434
{
3535
struct diff_filespec *one, *two;
3636

@@ -41,16 +41,16 @@ static void stuff_change(struct diff_options *opt,
4141
if (DIFF_OPT_TST(opt, REVERSE_DIFF)) {
4242
SWAP(old_mode, new_mode);
4343
SWAP(old_oid, new_oid);
44-
SWAP(old_name, new_name);
44+
SWAP(old_path, new_path);
4545
}
4646

4747
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)))
5050
return;
5151

52-
one = alloc_filespec(old_name);
53-
two = alloc_filespec(new_name);
52+
one = alloc_filespec(old_path);
53+
two = alloc_filespec(new_path);
5454
fill_filespec(one, old_oid->hash, old_oid_valid, old_mode);
5555
fill_filespec(two, new_oid->hash, new_oid_valid, new_mode);
5656

0 commit comments

Comments
 (0)