packfile: pass down repository to has_object[_kept]_pack
The functions `has_object[_kept]_pack` currently rely on the global variable `the_repository`. To eliminate global variable usage in `packfile.c`, we should progressively shift the dependency on the_repository to higher layers. Let's remove its usage from these functions and any related ones. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
873b00597b
commit
cc656f4eb2
3
diff.c
3
diff.c
@ -4041,7 +4041,8 @@ static int reuse_worktree_file(struct index_state *istate,
|
||||
* objects however would tend to be slower as they need
|
||||
* to be individually opened and inflated.
|
||||
*/
|
||||
if (!FAST_WORKING_DIRECTORY && !want_file && has_object_pack(oid))
|
||||
if (!FAST_WORKING_DIRECTORY && !want_file &&
|
||||
has_object_pack(istate->repo, oid))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user