2 * GIT - The information manager from hell
4 * Copyright (C) Linus Torvalds, 2005
8 int main(int argc, char **argv)
10 unsigned char sha1[20];
14 char template[] = "temp_git_file_XXXXXX";
17 if (argc != 2 || get_sha1_hex(argv[1], sha1))
18 usage("cat-file: cat-file <sha1>");
19 buf = read_sha1_file(sha1, type, &size);
22 fd = mkstemp(template);
24 usage("unable to create tempfile");
25 if (write(fd, buf, size) != size)
27 printf("%s: %s\n", template, type);