midx-write: pass down repository to write_midx_file[_only]
In a previous commit, we passed the repository field to all subcommands in the `builtin/` directory. Utilize this to pass the repository field down to the `write_midx_file[_only]` functions to remove the usage of `the_repository` global variables. With this, all usage of global variables in `midx-write.c` is removed, hence, remove the `USE_THE_REPOSITORY_VARIABLE` guard from the file. 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
dfa7c68245
commit
2fed09aa9b
10
midx.h
10
midx.h
@ -123,15 +123,13 @@ int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, i
|
||||
* Variant of write_midx_file which writes a MIDX containing only the packs
|
||||
* specified in packs_to_include.
|
||||
*/
|
||||
int write_midx_file(const char *object_dir,
|
||||
const char *preferred_pack_name,
|
||||
const char *refs_snapshot,
|
||||
int write_midx_file(struct repository *r, const char *object_dir,
|
||||
const char *preferred_pack_name, const char *refs_snapshot,
|
||||
unsigned flags);
|
||||
int write_midx_file_only(const char *object_dir,
|
||||
int write_midx_file_only(struct repository *r, const char *object_dir,
|
||||
struct string_list *packs_to_include,
|
||||
const char *preferred_pack_name,
|
||||
const char *refs_snapshot,
|
||||
unsigned flags);
|
||||
const char *refs_snapshot, unsigned flags);
|
||||
void clear_midx_file(struct repository *r);
|
||||
int verify_midx_file(struct repository *r, const char *object_dir, unsigned flags);
|
||||
int expire_midx_packs(struct repository *r, const char *object_dir, unsigned flags);
|
||||
|
Reference in New Issue
Block a user