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];
16 if (argc != 3 || get_sha1_hex(argv[2], sha1))
17 usage("cat-file: cat-file [-t | tagname] <sha1>");
18 buf = read_sha1_file(sha1, type, &size);
20 fprintf(stderr, "cat-file %s: bad file\n", argv[2]);
23 if (!strcmp("-t", argv[1])) {
28 } else if (strcmp(type, argv[1])) {
29 fprintf(stderr, "cat-file %s: bad tag\n", argv[2]);
30 exit(1); /* bad tag */
34 long ret = write(1, buf, size);
41 fprintf(stderr, "cat-file: %s\n", strerror(errno));
45 fprintf(stderr, "cat-file: disk full?");