tree-diff: move all action-taking code out of compare_tree_entry()
[gitweb.git] / log-tree.c
index e958d0748f11d82995f63d06b7e6ed05b2e7e4f1..08970bf46e49f6447ada24e81e5792ea9f92f419 100644 (file)
@@ -98,7 +98,7 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
        struct object *obj;
        enum decoration_type type = DECORATION_NONE;
 
-       if (!prefixcmp(refname, "refs/replace/")) {
+       if (starts_with(refname, "refs/replace/")) {
                unsigned char original_sha1[20];
                if (!read_replace_refs)
                        return 0;
@@ -116,11 +116,11 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
        if (!obj)
                return 0;
 
-       if (!prefixcmp(refname, "refs/heads/"))
+       if (starts_with(refname, "refs/heads/"))
                type = DECORATION_REF_LOCAL;
-       else if (!prefixcmp(refname, "refs/remotes/"))
+       else if (starts_with(refname, "refs/remotes/"))
                type = DECORATION_REF_REMOTE;
-       else if (!prefixcmp(refname, "refs/tags/"))
+       else if (starts_with(refname, "refs/tags/"))
                type = DECORATION_REF_TAG;
        else if (!strcmp(refname, "refs/stash"))
                type = DECORATION_REF_STASH;
@@ -134,6 +134,8 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
                obj = ((struct tag *)obj)->tagged;
                if (!obj)
                        break;
+               if (!obj->parsed)
+                       parse_object(obj->sha1);
                add_name_decoration(DECORATION_REF_TAG, refname, obj);
        }
        return 0;