[PATCH] Add git-verify-pack command.
[git/git.git] / verify-pack.c
1 #include "cache.h"
2 #include "pack.h"
3
4 static int verify_one_pack(char *arg)
5 {
6 struct packed_git *g = add_packed_git(arg, strlen(arg));
7 if (!g)
8 return -1;
9 return verify_pack(g);
10 }
11
12 int main(int ac, char **av)
13 {
14 int errs = 0;
15
16 while (1 < ac) {
17 char path[PATH_MAX];
18 strcpy(path, av[1]);
19 if (verify_one_pack(path))
20 errs++;
21 else
22 printf("%s: OK\n", av[1]);
23 ac--; av++;
24 }
25 return !!errs;
26 }