Skip to content

Commit 3b4ae6d

Browse files
mhaggergitster
authored andcommitted
pack_one_ref(): rename "path" parameter to "refname"
Make this function conform to the naming convention established in 65385ef for the rest of the refs.c file. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 32d462c commit 3b4ae6d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

refs.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,7 @@ static int do_not_prune(int flags)
20042004
return (flags & (REF_ISSYMREF|REF_ISPACKED));
20052005
}
20062006

2007-
static int pack_one_ref(const char *path, const unsigned char *sha1,
2007+
static int pack_one_ref(const char *refname, const unsigned char *sha1,
20082008
int flags, void *cb_data)
20092009
{
20102010
struct pack_refs_cb_data *cb = cb_data;
@@ -2014,27 +2014,27 @@ static int pack_one_ref(const char *path, const unsigned char *sha1,
20142014
/* Do not pack the symbolic refs */
20152015
if ((flags & REF_ISSYMREF))
20162016
return 0;
2017-
is_tag_ref = !prefixcmp(path, "refs/tags/");
2017+
is_tag_ref = !prefixcmp(refname, "refs/tags/");
20182018

20192019
/* ALWAYS pack refs that were already packed or are tags */
20202020
if (!(cb->flags & PACK_REFS_ALL) && !is_tag_ref && !(flags & REF_ISPACKED))
20212021
return 0;
20222022

2023-
fprintf(cb->refs_file, "%s %s\n", sha1_to_hex(sha1), path);
2023+
fprintf(cb->refs_file, "%s %s\n", sha1_to_hex(sha1), refname);
20242024

2025-
o = parse_object_or_die(sha1, path);
2025+
o = parse_object_or_die(sha1, refname);
20262026
if (o->type == OBJ_TAG) {
2027-
o = deref_tag(o, path, 0);
2027+
o = deref_tag(o, refname, 0);
20282028
if (o)
20292029
fprintf(cb->refs_file, "^%s\n",
20302030
sha1_to_hex(o->sha1));
20312031
}
20322032

20332033
if ((cb->flags & PACK_REFS_PRUNE) && !do_not_prune(flags)) {
2034-
int namelen = strlen(path) + 1;
2034+
int namelen = strlen(refname) + 1;
20352035
struct ref_to_prune *n = xcalloc(1, sizeof(*n) + namelen);
20362036
hashcpy(n->sha1, sha1);
2037-
strcpy(n->name, path);
2037+
strcpy(n->name, refname);
20382038
n->next = cb->ref_to_prune;
20392039
cb->ref_to_prune = n;
20402040
}

0 commit comments

Comments
 (0)