aboutsummaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-11-10 02:22:27 +0000
committerJeff King <peff@peff.net>2015-11-20 08:02:05 -0500
commit7999b2cf772956466baa8925491d6fb1b0963292 (patch)
tree34a3bf75c3cdc621d732107f53181ff28c0550a4 /pretty.c
parent3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28 (diff)
downloadgit-7999b2cf772956466baa8925491d6fb1b0963292.tar.gz
git-7999b2cf772956466baa8925491d6fb1b0963292.tar.xz
Add several uses of get_object_hash.
Convert most instances where the sha1 member of struct object is dereferenced to use get_object_hash. Most instances that are passed to functions that have versions taking struct object_id, such as get_sha1_hex/get_oid_hex, or instances that can be trivially converted to use struct object_id instead, are not converted. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pretty.c b/pretty.c
index 151c2ae31..fc257ccca 100644
--- a/pretty.c
+++ b/pretty.c
@@ -543,7 +543,7 @@ 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(get_object_hash(p->object), pp->abbrev);
if (!hex)
hex = sha1_to_hex(p->object.sha1);
parent = parent->next;
@@ -1119,7 +1119,7 @@ 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(get_object_hash(commit->object));
switch (placeholder[0]) {
case 'H': /* commit hash */
@@ -1133,7 +1133,7 @@ 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(get_object_hash(commit->object),
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;
@@ -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,
+ get_object_hash(p->item->object),
c->pretty_ctx->abbrev));
}
c->abbrev_parent_hashes.len = sb->len -