Skip to content

Commit 6afb265

Browse files
peffgitster
authored andcommitted
add_ref_decoration(): rename s/type/deco_type/
Now that we have two types (a decoration type and an object type) in the function, let's give them both unique names to avoid accidentally using one instead of the other. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 88473c8 commit 6afb265

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

log-tree.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
135135
{
136136
struct object *obj;
137137
enum object_type objtype;
138-
enum decoration_type type = DECORATION_NONE;
138+
enum decoration_type deco_type = DECORATION_NONE;
139139
struct decoration_filter *filter = (struct decoration_filter *)cb_data;
140140

141141
if (filter && !ref_filter_match(refname, filter))
@@ -162,17 +162,17 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
162162
obj = lookup_object_by_type(the_repository, oid, objtype);
163163

164164
if (starts_with(refname, "refs/heads/"))
165-
type = DECORATION_REF_LOCAL;
165+
deco_type = DECORATION_REF_LOCAL;
166166
else if (starts_with(refname, "refs/remotes/"))
167-
type = DECORATION_REF_REMOTE;
167+
deco_type = DECORATION_REF_REMOTE;
168168
else if (starts_with(refname, "refs/tags/"))
169-
type = DECORATION_REF_TAG;
169+
deco_type = DECORATION_REF_TAG;
170170
else if (!strcmp(refname, "refs/stash"))
171-
type = DECORATION_REF_STASH;
171+
deco_type = DECORATION_REF_STASH;
172172
else if (!strcmp(refname, "HEAD"))
173-
type = DECORATION_REF_HEAD;
173+
deco_type = DECORATION_REF_HEAD;
174174

175-
add_name_decoration(type, refname, obj);
175+
add_name_decoration(deco_type, refname, obj);
176176
while (obj->type == OBJ_TAG) {
177177
obj = ((struct tag *)obj)->tagged;
178178
if (!obj)

0 commit comments

Comments
 (0)