shortlog: optimize out useless "<none>" normalization
[gitweb.git] / builtin / diff.c
index 4326fa56bfa2021c6518c225eaa3f89b8b852e11..ed0acca91fb870d3f773779b34f4e24c401945e5 100644 (file)
@@ -175,8 +175,8 @@ static int builtin_diff_tree(struct rev_info *revs,
         */
        if (ent1->item->flags & UNINTERESTING)
                swap = 1;
-       sha1[swap] = ent0->item->sha1;
-       sha1[1 - swap] = ent1->item->sha1;
+       sha1[swap] = ent0->item->oid.hash;
+       sha1[1 - swap] = ent1->item->oid.hash;
        diff_tree_sha1(sha1[0], sha1[1], "", &revs->diffopt);
        log_tree_diff_flush(revs);
        return 0;
@@ -196,8 +196,8 @@ static int builtin_diff_combined(struct rev_info *revs,
        if (!revs->dense_combined_merges && !revs->combine_merges)
                revs->dense_combined_merges = revs->combine_merges = 1;
        for (i = 1; i < ents; i++)
-               sha1_array_append(&parents, ent[i].item->sha1);
-       diff_tree_combined(ent[0].item->sha1, &parents,
+               sha1_array_append(&parents, ent[i].item->oid.hash);
+       diff_tree_combined(ent[0].item->oid.hash, &parents,
                           revs->dense_combined_merges, revs);
        sha1_array_clear(&parents);
        return 0;
@@ -395,7 +395,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
                const char *name = entry->name;
                int flags = (obj->flags & UNINTERESTING);
                if (!obj->parsed)
-                       obj = parse_object(obj->sha1);
+                       obj = parse_object(obj->oid.hash);
                obj = deref_tag(obj, NULL, 0);
                if (!obj)
                        die(_("invalid object '%s' given."), name);
@@ -408,7 +408,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
                } else if (obj->type == OBJ_BLOB) {
                        if (2 <= blobs)
                                die(_("more than two blobs given: '%s'"), name);
-                       hashcpy(blob[blobs].sha1, obj->sha1);
+                       hashcpy(blob[blobs].sha1, obj->oid.hash);
                        blob[blobs].name = name;
                        blob[blobs].mode = entry->mode;
                        blobs++;