mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
csum-file: stop depending on the_repository
There are multiple sites in "csum-file.c" where we use the global `the_repository` variable, either explicitly or implicitly by using `the_hash_algo`. Refactor the code to stop using `the_repository` by adapting functions to receive required data as parameters. Adapt callsites accordingly by either using `the_repository->hash_algo`, or by using a context-provided hash algorithm in case the subsystem already got rid of its dependency on `the_repository`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e969bc8759
commit
228457c9d9
@@ -1342,10 +1342,12 @@ static int write_midx_internal(struct repository *r, const char *object_dir,
|
||||
return -1;
|
||||
}
|
||||
|
||||
f = hashfd(get_tempfile_fd(incr), get_tempfile_path(incr));
|
||||
f = hashfd(r->hash_algo, get_tempfile_fd(incr),
|
||||
get_tempfile_path(incr));
|
||||
} else {
|
||||
hold_lock_file_for_update(&lk, midx_name.buf, LOCK_DIE_ON_ERROR);
|
||||
f = hashfd(get_lock_file_fd(&lk), get_lock_file_path(&lk));
|
||||
f = hashfd(r->hash_algo, get_lock_file_fd(&lk),
|
||||
get_lock_file_path(&lk));
|
||||
}
|
||||
|
||||
cf = init_chunkfile(f);
|
||||
|
||||
Reference in New Issue
Block a user