Skip to content

Commit

Permalink
DO-NOT-MERGE: compute multi-pack-index on repack
Browse files Browse the repository at this point in the history
This commit is only for testing purposes. By computing a multi-pack-index
on every repack and ignoring the core.multiPackIndex config setting, we
can check the behavior of the multi-pack-index with the rest of the test
suite.

Signed-off-by: Derrick Stolee <[email protected]>
  • Loading branch information
derrickstolee committed Aug 20, 2018
1 parent 4eb5df3 commit 098dd1d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions builtin/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (!no_update_server_info)
update_server_info(0);
remove_temporary_files();
write_midx_file(get_object_directory());
string_list_clear(&names, 0);
string_list_clear(&rollback, 0);
string_list_clear(&existing_packs, 0);
Expand Down
5 changes: 0 additions & 5 deletions midx.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,6 @@ int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, i
{
struct multi_pack_index *m;
struct multi_pack_index *m_search;
int config_value;

if (repo_config_get_bool(r, "core.multipackindex", &config_value) ||
!config_value)
return 0;

for (m_search = r->objects->multi_pack_index; m_search; m_search = m_search->next)
if (!strcmp(object_dir, m_search->object_dir))
Expand Down
1 change: 1 addition & 0 deletions t/t5310-pack-bitmaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ test_expect_success 'pack-objects respects --honor-pack-keep (local bitmapped pa

test_expect_success 'pack-objects respects --local (non-local bitmapped pack)' '
mv .git/objects/pack/$packbitmap.* alt.git/objects/pack/ &&
rm .git/objects/pack/multi-pack-index &&
test_when_finished "mv alt.git/objects/pack/$packbitmap.* .git/objects/pack/" &&
echo HEAD | git pack-objects --local --stdout --revs >3b.pack &&
git index-pack 3b.pack &&
Expand Down
6 changes: 0 additions & 6 deletions t/t5319-multi-pack-index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ test_expect_success 'write midx with twelve packs' '

compare_results_with_midx "twelve packs"

test_expect_success 'repack removes multi-pack-index' '
test_path_is_file $objdir/pack/multi-pack-index &&
git repack -adf &&
test_path_is_missing $objdir/pack/multi-pack-index
'

compare_results_with_midx "after repack"

test_expect_success 'multi-pack-index and pack-bitmap' '
Expand Down

0 comments on commit 098dd1d

Please sign in to comment.