]> git.ipfire.org Git - thirdparty/git.git/commitdiff
add_ref_decoration(): rename s/type/deco_type/
authorJeff King <peff@peff.net>
Tue, 22 Jun 2021 17:09:26 +0000 (13:09 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Jun 2021 03:32:32 +0000 (20:32 -0700)
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>
log-tree.c

index c3c8e7e1df4ae58617db6969ebe269c8507dd548..4f69ed176db40639890f8a2f5eb9c2982309018e 100644 (file)
@@ -135,7 +135,7 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
 {
        struct object *obj;
        enum object_type objtype;
-       enum decoration_type type = DECORATION_NONE;
+       enum decoration_type deco_type = DECORATION_NONE;
        struct decoration_filter *filter = (struct decoration_filter *)cb_data;
 
        if (filter && !ref_filter_match(refname, filter))
@@ -162,17 +162,17 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
        obj = lookup_object_by_type(the_repository, oid, objtype);
 
        if (starts_with(refname, "refs/heads/"))
-               type = DECORATION_REF_LOCAL;
+               deco_type = DECORATION_REF_LOCAL;
        else if (starts_with(refname, "refs/remotes/"))
-               type = DECORATION_REF_REMOTE;
+               deco_type = DECORATION_REF_REMOTE;
        else if (starts_with(refname, "refs/tags/"))
-               type = DECORATION_REF_TAG;
+               deco_type = DECORATION_REF_TAG;
        else if (!strcmp(refname, "refs/stash"))
-               type = DECORATION_REF_STASH;
+               deco_type = DECORATION_REF_STASH;
        else if (!strcmp(refname, "HEAD"))
-               type = DECORATION_REF_HEAD;
+               deco_type = DECORATION_REF_HEAD;
 
-       add_name_decoration(type, refname, obj);
+       add_name_decoration(deco_type, refname, obj);
        while (obj->type == OBJ_TAG) {
                obj = ((struct tag *)obj)->tagged;
                if (!obj)