From 14228447c9ce664a4e9c31ba10344ec5e4ea4ba5 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 26 Apr 2021 01:02:56 +0000 Subject: hash: provide per-algorithm null OIDs Up until recently, object IDs did not have an algorithm member, only a hash. Consequently, it was possible to share one null (all-zeros) object ID among all hash algorithms. Now that we're going to be handling objects from multiple hash algorithms, it's important to make sure that all object IDs have a correct algorithm field. Introduce a per-algorithm null OID, and add it to struct hash_algo. Introduce a wrapper function as well, and use it everywhere we used to use the null_oid constant. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- wt-status.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wt-status.c') diff --git a/wt-status.c b/wt-status.c index 1aed68c43c..7603c1b198 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1687,10 +1687,10 @@ void wt_status_get_state(struct repository *r, if (!sequencer_get_last_command(r, &action)) { if (action == REPLAY_PICK) { state->cherry_pick_in_progress = 1; - oidcpy(&state->cherry_pick_head_oid, &null_oid); + oidcpy(&state->cherry_pick_head_oid, null_oid()); } else { state->revert_in_progress = 1; - oidcpy(&state->revert_head_oid, &null_oid); + oidcpy(&state->revert_head_oid, null_oid()); } } if (get_detached_from) -- cgit v1.2.3