3 int main(int argc, char **argv)
5 unsigned char sha1[20];
9 char template[] = "temp_git_file_XXXXXX";
12 if (argc != 2 || get_sha1_hex(argv[1], sha1))
13 usage("cat-file: cat-file <sha1>");
14 buf = read_sha1_file(sha1, type, &size);
17 fd = mkstemp(template);
19 usage("unable to create tempfile");
20 if (write(fd, buf, size) != size)
22 printf("%s: %s\n", template, type);