Skip to content

Commit 447af49

Browse files
committed
Merge branch 'kn/midx-wo-the-repository' into seen
* 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
2 parents 5a43b77 + 36a7b11 commit 447af49

File tree

8 files changed

+151
-128
lines changed

8 files changed

+151
-128
lines changed

builtin/multi-pack-index.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static void read_packs_from_stdin(struct string_list *to)
120120

121121
static int cmd_multi_pack_index_write(int argc, const char **argv,
122122
const char *prefix,
123-
struct repository *repo UNUSED)
123+
struct repository *repo)
124124
{
125125
struct option *options;
126126
static struct option builtin_multi_pack_index_write_options[] = {
@@ -165,7 +165,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
165165

166166
read_packs_from_stdin(&packs);
167167

168-
ret = write_midx_file_only(opts.object_dir, &packs,
168+
ret = write_midx_file_only(repo, opts.object_dir, &packs,
169169
opts.preferred_pack,
170170
opts.refs_snapshot, opts.flags);
171171

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

177177
}
178178

179-
ret = write_midx_file(opts.object_dir, opts.preferred_pack,
179+
ret = write_midx_file(repo, opts.object_dir, opts.preferred_pack,
180180
opts.refs_snapshot, opts.flags);
181181

182182
free(opts.refs_snapshot);

builtin/repack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ int cmd_repack(int argc,
15761576
unsigned flags = 0;
15771577
if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL, 0))
15781578
flags |= MIDX_WRITE_INCREMENTAL;
1579-
write_midx_file(repo_get_object_directory(the_repository),
1579+
write_midx_file(the_repository, repo_get_object_directory(the_repository),
15801580
NULL, NULL, flags);
15811581
}
15821582

0 commit comments

Comments
 (0)