Convert struct object to object_id
struct object is one of the major data structures dealing with object IDs. Convert it to use struct object_id instead of an unsigned char array. Convert get_object_hash to refer to the new member as well. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Jeff King <peff@peff.net>
This commit is contained in:
committed by
Jeff King
parent
7999b2cf77
commit
f2fd0760f6
10
pretty.c
10
pretty.c
@ -545,7 +545,7 @@ static void add_merge_info(const struct pretty_print_context *pp,
|
||||
if (pp->abbrev)
|
||||
hex = find_unique_abbrev(get_object_hash(p->object), 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);
|
||||
@ -1124,7 +1124,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
|
||||
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 */
|
||||
@ -1139,12 +1139,12 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
|
||||
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 */
|
||||
|
||||
Reference in New Issue
Block a user