summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-12-10 20:36:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-12-10 20:36:13 (GMT)
commit844a9ce47208de173341525c15a4c8c689dd278e (patch)
treed771915b28609179ddf1f3f911bcb30b7019d7cf /pretty.c
parentb12a966eff3f66337f83c117dbab8fa0cca16e4b (diff)
parentfcd30b138759a2ab5ecb55758c3341f0d608df2b (diff)
downloadgit-844a9ce47208de173341525c15a4c8c689dd278e.zip
git-844a9ce47208de173341525c15a4c8c689dd278e.tar.gz
git-844a9ce47208de173341525c15a4c8c689dd278e.tar.bz2
Merge branch 'bc/object-id'
More transition from "unsigned char[40]" to "struct object_id". This needed a few merge fixups, but is mostly disentangled from other topics. * bc/object-id: remote: convert functions to struct object_id Remove get_object_hash. Convert struct object to object_id Add several uses of get_object_hash. object: introduce get_object_hash macro. ref_newer: convert to use struct object_id push_refs_with_export: convert to struct object_id get_remote_heads: convert to struct object_id parse_fetch: convert to use struct object_id add_sought_entry_mem: convert to struct object_id Convert struct ref to use object_id. sha1_file: introduce has_object_file helper.
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/pretty.c b/pretty.c
index 151c2ae..92b2870 100644
--- 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 -