3 int main(int ac, char **av)
6 unsigned char sha1[20];
12 if (!strcmp(av[1], "-b"))
15 bufsz = strtoul(av[1], NULL, 10) * 1024 * 1024;
21 while ((buffer = malloc(bufsz)) == NULL) {
22 fprintf(stderr, "bufsz %u is too big, halving...\n", bufsz);
33 unsigned room = bufsz;
36 sz = xread(0, cp, room);
40 die_errno("test-sha1");
47 git_SHA1_Update(&ctx, buffer, this_sz);
49 git_SHA1_Final(sha1, &ctx);
52 fwrite(sha1, 1, 20, stdout);
54 puts(sha1_to_hex(sha1));