From mboxrd@z Thu Jan 1 00:00:00 1970 From: list at eworm.de (Christian Hesse) Date: Mon, 15 Aug 2016 11:03:24 +0200 Subject: [PATCH 1/1] RFC: git: update to v2.10.0-rc0 part 2 In-Reply-To: <20160815084729.6gty4vgly3lor7ff@john.keeping.me.uk> References: <20160815084729.6gty4vgly3lor7ff@john.keeping.me.uk> Message-ID: <20160815090324.12408-1-list@eworm.de> From: Christian Hesse Just a follow-up to replace more sha1 with oid. Signed-off-by: Christian Hesse --- ui-diff.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ui-diff.c b/ui-diff.c index 0819919..173d351 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -21,8 +21,8 @@ static int lines_added, lines_removed; static struct fileinfo { char status; - unsigned char old_sha1[20]; - unsigned char new_sha1[20]; + struct object_id old_oid[1]; + struct object_id new_oid[1]; unsigned short old_mode; unsigned short new_mode; char *old_path; @@ -83,15 +83,15 @@ static void print_fileinfo(struct fileinfo *info) html(""); htmlf(""); - if (is_null_sha1(info->new_sha1)) { + if (is_null_oid(info->new_oid)) { cgit_print_filemode(info->old_mode); } else { cgit_print_filemode(info->new_mode); } if (info->old_mode != info->new_mode && - !is_null_sha1(info->old_sha1) && - !is_null_sha1(info->new_sha1)) { + !is_null_oid(info->old_oid) && + !is_null_oid(info->new_oid)) { html("["); cgit_print_filemode(info->old_mode); html("]"); @@ -170,8 +170,8 @@ static void inspect_filepair(struct diff_filepair *pair) items = xrealloc(items, slots * sizeof(struct fileinfo)); } items[files-1].status = pair->status; - hashcpy(items[files-1].old_sha1, pair->one->oid.hash); - hashcpy(items[files-1].new_sha1, pair->two->oid.hash); + oidcpy(items[files-1].old_oid, &pair->one->oid); + oidcpy(items[files-1].new_oid, &pair->two->oid); items[files-1].old_mode = pair->one->mode; items[files-1].new_mode = pair->two->mode; items[files-1].old_path = xstrdup(pair->one->path); @@ -422,9 +422,9 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, return; } } else if (commit->parents && commit->parents->item) { - hashcpy(old_rev_oid->hash, commit->parents->item->object.oid.hash); + oidcpy(old_rev_oid, &commit->parents->item->object.oid); } else { - hashclr(old_rev_oid->hash); + oidclr(old_rev_oid); } if (!is_null_oid(old_rev_oid)) { -- 2.9.3