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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jun 22, 2021 at 13:09 UTC
6afb265b9675b1e6061f53a323825db239f6e0fa
1 file changed
+7
-7
log-tree.c
+7
-7
@@ -135,7 +135,7 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
135
{
136
struct object *obj;
137
enum object_type objtype;
138
- enum decoration_type type = DECORATION_NONE;
138
+ enum decoration_type deco_type = DECORATION_NONE;
139
struct decoration_filter *filter = (struct decoration_filter *)cb_data;
140
141
if (filter && !ref_filter_match(refname, filter))
@@ -162,17 +162,17 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
162
obj = lookup_object_by_type(the_repository, oid, objtype);
163
164
if (starts_with(refname, "refs/heads/"))
165
- type = DECORATION_REF_LOCAL;
165
+ deco_type = DECORATION_REF_LOCAL;
166
else if (starts_with(refname, "refs/remotes/"))
167
- type = DECORATION_REF_REMOTE;
167
+ deco_type = DECORATION_REF_REMOTE;
168
else if (starts_with(refname, "refs/tags/"))
169
- type = DECORATION_REF_TAG;
169
+ deco_type = DECORATION_REF_TAG;
170
else if (!strcmp(refname, "refs/stash"))
171
- type = DECORATION_REF_STASH;
171
+ deco_type = DECORATION_REF_STASH;
172
else if (!strcmp(refname, "HEAD"))
173
- type = DECORATION_REF_HEAD;
173
+ deco_type = DECORATION_REF_HEAD;
174
175
- add_name_decoration(type, refname, obj);
175
+ add_name_decoration(deco_type, refname, obj);
176
while (obj->type == OBJ_TAG) {
177
obj = ((struct tag *)obj)->tagged;
178
if (!obj)