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];
15 if (argc
!= 3 || get_sha1(argv
[2], sha1
))
16 usage("cat-file [-t | tagname] <sha1>");
17 buf
= read_sha1_file(sha1
, type
, &size
);
19 die("cat-file %s: bad file", argv
[2]);
20 if (!strcmp("-t", argv
[1])) {
25 } else if (strcmp(type
, argv
[1])) {
26 die("cat-file %s: bad tag", argv
[2]);
30 long ret
= write(1, buf
, size
);
37 die("cat-file: %s", strerror(errno
));
39 die("cat-file: disk full?");