diff options
Diffstat (limited to 'verify-pack.c')
-rw-r--r-- | verify-pack.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/verify-pack.c b/verify-pack.c new file mode 100644 index 0000000000..3ae5ac1b4f --- /dev/null +++ b/verify-pack.c @@ -0,0 +1,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; +} |