summaryrefslogtreecommitdiff
path: root/verify-pack.c
blob: 3ae5ac1b4fd9440eb01d3a682375e4061355d6df (plain)
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
#include "cache.h"
#include "pack.h"

static int verify_one_pack(char *arg)
{
	struct packed_git *g = add_packed_git(arg, strlen(arg));
	if (!g)
		return -1;
	return verify_pack(g);
}

int main(int ac, char **av)
{
	int errs = 0;

	while (1 < ac) {
		char path[PATH_MAX];
		strcpy(path, av[1]);
		if (verify_one_pack(path))
			errs++;
		else
			printf("%s: OK\n", av[1]);
		ac--; av++;
	}
	return !!errs;
}