diff --git a/builtin/blame.c b/builtin/blame.c index 126b8c9e5ba627ee5514f5a472bd7ae5cb9f9f67..cffc62654084b025ffbdb947448fa86c81dc6442 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -1901,7 +1901,7 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent, struct origin *suspect = ent->suspect; char hex[GIT_SHA1_HEXSZ + 1]; - sha1_to_hex_r(hex, suspect->commit->object.oid.hash); + oid_to_hex_r(hex, &suspect->commit->object.oid); printf("%s %d %d %d\n", hex, ent->s_lno + 1, @@ -1941,7 +1941,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt) int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP); get_commit_info(suspect->commit, &ci, 1); - sha1_to_hex_r(hex, suspect->commit->object.oid.hash); + oid_to_hex_r(hex, &suspect->commit->object.oid); cp = nth_line(sb, ent->lno); for (cnt = 0; cnt < ent->num_lines; cnt++) { diff --git a/builtin/checkout.c b/builtin/checkout.c index bfe685c198cd38b59ffe66fa6b3d3a7bced60824..80d5e389813bed951b63ae5bd8e4347af4da53df 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -56,8 +56,8 @@ static int post_checkout_hook(struct commit *old, struct commit *new, int changed) { return run_hook_le(NULL, "post-checkout", - sha1_to_hex(old ? old->object.oid.hash : null_sha1), - sha1_to_hex(new ? new->object.oid.hash : null_sha1), + oid_to_hex(old ? &old->object.oid : &null_oid), + oid_to_hex(new ? &new->object.oid : &null_oid), changed ? "1" : "0", NULL); /* "new" can be NULL when checking out from the index before a commit exists. */ diff --git a/builtin/merge-index.c b/builtin/merge-index.c index ce356b1da126e31b4ef78b29dcc49246881b6a59..2d1b6db6bd7a33f838a50deceb108ee1ad468db1 100644 --- a/builtin/merge-index.c +++ b/builtin/merge-index.c @@ -22,7 +22,7 @@ static int merge_entry(int pos, const char *path) if (strcmp(ce->name, path)) break; found++; - sha1_to_hex_r(hexbuf[stage], ce->oid.hash); + oid_to_hex_r(hexbuf[stage], &ce->oid); xsnprintf(ownbuf[stage], sizeof(ownbuf[stage]), "%o", ce->ce_mode); arguments[stage] = hexbuf[stage]; arguments[stage + 4] = ownbuf[stage]; diff --git a/builtin/rev-list.c b/builtin/rev-list.c index c43decda70112a9cdb7789dc81394286459aa3af..0aa93d58919742852b05b952e8e35b5270f74ba8 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -237,7 +237,7 @@ static int show_bisect_vars(struct rev_list_info *info, int reaches, int all) cnt = reaches; if (revs->commits) - sha1_to_hex_r(hex, revs->commits->item->object.oid.hash); + oid_to_hex_r(hex, &revs->commits->item->object.oid); if (flags & BISECT_SHOW_ALL) { traverse_commit_list(revs, show_commit, show_object, info); diff --git a/diff.c b/diff.c index f08cd8e033d104253a4b120f70cb188e39ef9aee..d91a344908abe7335eaffef4157fc59fefdf3815 100644 --- a/diff.c +++ b/diff.c @@ -3015,7 +3015,7 @@ static struct diff_tempfile *prepare_temp_file(const char *name, if (!one->oid_valid) sha1_to_hex_r(temp->hex, null_sha1); else - sha1_to_hex_r(temp->hex, one->oid.hash); + oid_to_hex_r(temp->hex, &one->oid); /* Even though we may sometimes borrow the * contents from the work tree, we always want * one->mode. mode is trustworthy even when diff --git a/refs/files-backend.c b/refs/files-backend.c index f9023939d5884e0f975d5997336313695e407ca1..8ee2aba39f2b0bae36e66bc65610b429543bc1d8 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -697,7 +697,7 @@ static int cache_ref_iterator_peel(struct ref_iterator *ref_iterator, if (peel_entry(entry, 0)) return -1; - hashcpy(peeled->hash, entry->u.value.peeled.hash); + oidcpy(peeled, &entry->u.value.peeled); return 0; } diff --git a/wt-status.c b/wt-status.c index 4dff0b3e2108bbd41e638c7beb69e62b20fa8740..d47012048f81c92a82758d87f8726cb919501104 100644 --- a/wt-status.c +++ b/wt-status.c @@ -628,7 +628,7 @@ static void wt_status_collect_changes_initial(struct wt_status *s) d->index_status = DIFF_STATUS_ADDED; /* Leave {mode,oid}_head zero for adds. */ d->mode_index = ce->ce_mode; - hashcpy(d->oid_index.hash, ce->oid.hash); + oidcpy(&d->oid_index, &ce->oid); } } } @@ -2102,7 +2102,7 @@ static void wt_porcelain_v2_print_unmerged_entry( if (strcmp(ce->name, it->string) || !stage) break; stages[stage - 1].mode = ce->ce_mode; - hashcpy(stages[stage - 1].oid.hash, ce->oid.hash); + oidcpy(&stages[stage - 1].oid, &ce->oid); sum |= (1 << (stage - 1)); } if (sum != d->stagemask)