File: test-bitmap.c

package info (click to toggle)
git 1%3A2.50.1-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 61,696 kB
  • sloc: ansic: 302,907; sh: 260,696; perl: 27,874; tcl: 22,303; makefile: 4,280; python: 3,442; javascript: 772; csh: 45; lisp: 12
file content (55 lines) | stat: -rw-r--r-- 1,499 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#define USE_THE_REPOSITORY_VARIABLE

#include "test-tool.h"
#include "git-compat-util.h"
#include "pack-bitmap.h"
#include "setup.h"

static int bitmap_list_commits(void)
{
	return test_bitmap_commits(the_repository);
}

static int bitmap_dump_hashes(void)
{
	return test_bitmap_hashes(the_repository);
}

static int bitmap_dump_pseudo_merges(void)
{
	return test_bitmap_pseudo_merges(the_repository);
}

static int bitmap_dump_pseudo_merge_commits(uint32_t n)
{
	return test_bitmap_pseudo_merge_commits(the_repository, n);
}

static int bitmap_dump_pseudo_merge_objects(uint32_t n)
{
	return test_bitmap_pseudo_merge_objects(the_repository, n);
}

int cmd__bitmap(int argc, const char **argv)
{
	setup_git_directory();

	if (argc == 2 && !strcmp(argv[1], "list-commits"))
		return bitmap_list_commits();
	if (argc == 2 && !strcmp(argv[1], "dump-hashes"))
		return bitmap_dump_hashes();
	if (argc == 2 && !strcmp(argv[1], "dump-pseudo-merges"))
		return bitmap_dump_pseudo_merges();
	if (argc == 3 && !strcmp(argv[1], "dump-pseudo-merge-commits"))
		return bitmap_dump_pseudo_merge_commits(atoi(argv[2]));
	if (argc == 3 && !strcmp(argv[1], "dump-pseudo-merge-objects"))
		return bitmap_dump_pseudo_merge_objects(atoi(argv[2]));

	usage("\ttest-tool bitmap list-commits\n"
	      "\ttest-tool bitmap dump-hashes\n"
	      "\ttest-tool bitmap dump-pseudo-merges\n"
	      "\ttest-tool bitmap dump-pseudo-merge-commits <n>\n"
	      "\ttest-tool bitmap dump-pseudo-merge-objects <n>");

	return -1;
}