Skip to content

Commit a7cd24d

Browse files
shreyp135gitster
authored andcommitted
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>
1 parent 9d0d2ba commit a7cd24d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

wt-status.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,10 +1815,10 @@ void wt_status_get_state(struct repository *r,
18151815
if (!sequencer_get_last_command(r, &action)) {
18161816
if (action == REPLAY_PICK && !state->cherry_pick_in_progress) {
18171817
state->cherry_pick_in_progress = 1;
1818-
oidcpy(&state->cherry_pick_head_oid, null_oid(the_hash_algo));
1818+
oidcpy(&state->cherry_pick_head_oid, null_oid(r->hash_algo));
18191819
} else if (action == REPLAY_REVERT && !state->revert_in_progress) {
18201820
state->revert_in_progress = 1;
1821-
oidcpy(&state->revert_head_oid, null_oid(the_hash_algo));
1821+
oidcpy(&state->revert_head_oid, null_oid(r->hash_algo));
18221822
}
18231823
}
18241824
if (get_detached_from)
@@ -2630,7 +2630,7 @@ int has_uncommitted_changes(struct repository *r,
26302630
* We have no head (or it's corrupt); use the empty tree,
26312631
* which will complain if the index is non-empty.
26322632
*/
2633-
struct tree *tree = lookup_tree(r, the_hash_algo->empty_tree);
2633+
struct tree *tree = lookup_tree(r, r->hash_algo->empty_tree);
26342634
add_pending_object(&rev_info, &tree->object, "");
26352635
}
26362636

0 commit comments

Comments
 (0)