diff options
| author | Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> | 2026-02-18 23:23:42 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-19 08:59:24 -0800 |
| commit | a7cd24de0b3b679c16ae3ee8215af06aeea1e6a3 (patch) | |
| tree | 4fcc32ab87b405b6549f713cc66a62969254d155 | |
| parent | 9d0d2ba217f3ceefb0315b556f012edb598b9724 (diff) | |
| download | git-a7cd24de0b3b679c16ae3ee8215af06aeea1e6a3.tar.xz | |
wt-status: use hash_algo from local repository instead of global the_hash_algo
wt-status.c still uses the global the_hash_algo even though a repository
instance is already available via struct wt_status.
Replace uses of the_hash_algo with the hash algorithm stored in the
associated repository (s->repo->hash_algo or r->hash_algo).
This removes another dependency on global state and keeps wt-status
consistent with local repository usage.
Signed-off-by: Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rw-r--r-- | wt-status.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wt-status.c b/wt-status.c index b44b8377e5..264281fb67 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1815,10 +1815,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) { state->cherry_pick_in_progress = 1; - oidcpy(&state->cherry_pick_head_oid, null_oid(the_hash_algo)); + oidcpy(&state->cherry_pick_head_oid, null_oid(r->hash_algo)); } else if (action == REPLAY_REVERT && !state->revert_in_progress) { state->revert_in_progress = 1; - oidcpy(&state->revert_head_oid, null_oid(the_hash_algo)); + oidcpy(&state->revert_head_oid, null_oid(r->hash_algo)); } } if (get_detached_from) @@ -2630,7 +2630,7 @@ int has_uncommitted_changes(struct repository *r, * We have no head (or it's corrupt); use the empty tree, * which will complain if the index is non-empty. */ - struct tree *tree = lookup_tree(r, the_hash_algo->empty_tree); + struct tree *tree = lookup_tree(r, r->hash_algo->empty_tree); add_pending_object(&rev_info, &tree->object, ""); } |
