Merge branch 'tg/git-remote'
[gitweb.git] / pretty.c
index 151c2ae3128bb7c1a0ae13166539cb79e6edaeb8..92b2870a7eabb6a99ffbbcfc222d2ff1c1186fa0 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -543,9 +543,9 @@ static void add_merge_info(const struct pretty_print_context *pp,
                struct commit *p = parent->item;
                const char *hex = NULL;
                if (pp->abbrev)
-                       hex = find_unique_abbrev(p->object.sha1, pp->abbrev);
+                       hex = find_unique_abbrev(p->object.oid.hash, pp->abbrev);
                if (!hex)
-                       hex = sha1_to_hex(p->object.sha1);
+                       hex = oid_to_hex(&p->object.oid);
                parent = parent->next;
 
                strbuf_addf(sb, " %s", hex);
@@ -1119,12 +1119,12 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
 
        /* these depend on the commit */
        if (!commit->object.parsed)
-               parse_object(commit->object.sha1);
+               parse_object(commit->object.oid.hash);
 
        switch (placeholder[0]) {
        case 'H':               /* commit hash */
                strbuf_addstr(sb, diff_get_color(c->auto_color, DIFF_COMMIT));
-               strbuf_addstr(sb, sha1_to_hex(commit->object.sha1));
+               strbuf_addstr(sb, oid_to_hex(&commit->object.oid));
                strbuf_addstr(sb, diff_get_color(c->auto_color, DIFF_RESET));
                return 1;
        case 'h':               /* abbreviated commit hash */
@@ -1133,18 +1133,18 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
                        strbuf_addstr(sb, diff_get_color(c->auto_color, DIFF_RESET));
                        return 1;
                }
-               strbuf_addstr(sb, find_unique_abbrev(commit->object.sha1,
+               strbuf_addstr(sb, find_unique_abbrev(commit->object.oid.hash,
                                                     c->pretty_ctx->abbrev));
                strbuf_addstr(sb, diff_get_color(c->auto_color, DIFF_RESET));
                c->abbrev_commit_hash.len = sb->len - c->abbrev_commit_hash.off;
                return 1;
        case 'T':               /* tree hash */
-               strbuf_addstr(sb, sha1_to_hex(commit->tree->object.sha1));
+               strbuf_addstr(sb, oid_to_hex(&commit->tree->object.oid));
                return 1;
        case 't':               /* abbreviated tree hash */
                if (add_again(sb, &c->abbrev_tree_hash))
                        return 1;
-               strbuf_addstr(sb, find_unique_abbrev(commit->tree->object.sha1,
+               strbuf_addstr(sb, find_unique_abbrev(commit->tree->object.oid.hash,
                                                     c->pretty_ctx->abbrev));
                c->abbrev_tree_hash.len = sb->len - c->abbrev_tree_hash.off;
                return 1;
@@ -1152,7 +1152,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
                for (p = commit->parents; p; p = p->next) {
                        if (p != commit->parents)
                                strbuf_addch(sb, ' ');
-                       strbuf_addstr(sb, sha1_to_hex(p->item->object.sha1));
+                       strbuf_addstr(sb, oid_to_hex(&p->item->object.oid));
                }
                return 1;
        case 'p':               /* abbreviated parent hashes */
@@ -1162,7 +1162,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
                        if (p != commit->parents)
                                strbuf_addch(sb, ' ');
                        strbuf_addstr(sb, find_unique_abbrev(
-                                       p->item->object.sha1,
+                                       p->item->object.oid.hash,
                                        c->pretty_ctx->abbrev));
                }
                c->abbrev_parent_hashes.len = sb->len -