483fa7f42d
Add a new 'bitmap' test-tool which can be used to list the commits that have received bitmaps. In theory, a determined tester could run 'git rev-list --test-bitmap <commit>' to check if '<commit>' received a bitmap or not, since '--test-bitmap' exits with a non-zero code when it can't find the requested commit. But this is a dubious behavior to rely on, since arguably 'git rev-list' could continue its object walk outside of which commits are covered by bitmaps. This will be used to test the behavior of 'pack.preferBitmapTips', which will be added in the following patch. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
25 lines
395 B
C
25 lines
395 B
C
#include "test-tool.h"
|
|
#include "cache.h"
|
|
#include "pack-bitmap.h"
|
|
|
|
static int bitmap_list_commits(void)
|
|
{
|
|
return test_bitmap_commits(the_repository);
|
|
}
|
|
|
|
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();
|
|
|
|
usage:
|
|
usage("\ttest-tool bitmap list-commits");
|
|
|
|
return -1;
|
|
}
|