Skip to content

Commit

Permalink
Merge branch 'kn/midx-wo-the-repository' into seen
Browse files Browse the repository at this point in the history
* kn/midx-wo-the-repository:
  midx: inline the `MIDX_MIN_SIZE` definition
  midx: pass down `hash_algo` to functions using global variables
  midx: pass `repository` to `load_multi_pack_index`
  midx: cleanup internal usage of `the_repository` and `the_hash_algo`
  midx-write: pass down repository to `write_midx_file[_only]`
  write-midx: add repository field to `write_midx_context`
  midx-write: use `revs->repo` inside `read_refs_snapshot`
  midx-write: pass down repository to static functions
  • Loading branch information
gitster committed Nov 28, 2024
2 parents 5a43b77 + 36a7b11 commit 447af49
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 128 deletions.
6 changes: 3 additions & 3 deletions builtin/multi-pack-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static void read_packs_from_stdin(struct string_list *to)

static int cmd_multi_pack_index_write(int argc, const char **argv,
const char *prefix,
struct repository *repo UNUSED)
struct repository *repo)
{
struct option *options;
static struct option builtin_multi_pack_index_write_options[] = {
Expand Down Expand Up @@ -165,7 +165,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,

read_packs_from_stdin(&packs);

ret = write_midx_file_only(opts.object_dir, &packs,
ret = write_midx_file_only(repo, opts.object_dir, &packs,
opts.preferred_pack,
opts.refs_snapshot, opts.flags);

Expand All @@ -176,7 +176,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,

}

ret = write_midx_file(opts.object_dir, opts.preferred_pack,
ret = write_midx_file(repo, opts.object_dir, opts.preferred_pack,
opts.refs_snapshot, opts.flags);

free(opts.refs_snapshot);
Expand Down
2 changes: 1 addition & 1 deletion builtin/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ int cmd_repack(int argc,
unsigned flags = 0;
if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL, 0))
flags |= MIDX_WRITE_INCREMENTAL;
write_midx_file(repo_get_object_directory(the_repository),
write_midx_file(the_repository, repo_get_object_directory(the_repository),
NULL, NULL, flags);
}

Expand Down
Loading

0 comments on commit 447af49

Please sign in to comment.