2021-04-01 03:32:11 +02:00
|
|
|
#include "test-tool.h"
|
2023-03-21 07:26:04 +01:00
|
|
|
#include "git-compat-util.h"
|
2021-04-01 03:32:11 +02:00
|
|
|
#include "pack-bitmap.h"
|
2023-03-21 07:26:05 +01:00
|
|
|
#include "setup.h"
|
2021-04-01 03:32:11 +02:00
|
|
|
|
|
|
|
static int bitmap_list_commits(void)
|
|
|
|
{
|
|
|
|
return test_bitmap_commits(the_repository);
|
|
|
|
}
|
|
|
|
|
2021-09-15 00:06:02 +02:00
|
|
|
static int bitmap_dump_hashes(void)
|
|
|
|
{
|
|
|
|
return test_bitmap_hashes(the_repository);
|
|
|
|
}
|
|
|
|
|
2021-04-01 03:32:11 +02:00
|
|
|
int cmd__bitmap(int argc, const char **argv)
|
|
|
|
{
|
|
|
|
setup_git_directory();
|
|
|
|
|
|
|
|
if (argc != 2)
|
|
|
|
goto usage;
|
|
|
|
|
|
|
|
if (!strcmp(argv[1], "list-commits"))
|
|
|
|
return bitmap_list_commits();
|
2021-09-15 00:06:02 +02:00
|
|
|
if (!strcmp(argv[1], "dump-hashes"))
|
|
|
|
return bitmap_dump_hashes();
|
2021-04-01 03:32:11 +02:00
|
|
|
|
|
|
|
usage:
|
2021-09-15 00:06:02 +02:00
|
|
|
usage("\ttest-tool bitmap list-commits\n"
|
|
|
|
"\ttest-tool bitmap dump-hashes");
|
2021-04-01 03:32:11 +02:00
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|