| * Copyright (c) 2005, 2006 Rene Scharfe |
| static const char builtin_get_tar_commit_id_usage[] = |
| "git get-tar-commit-id < <tarfile>"; |
| /* ustar header + extended global header content */ |
| #define HEADERSIZE (2 * RECORDSIZE) |
| int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix) |
| struct ustar_header *header = (struct ustar_header *)buffer; |
| char *content = buffer + RECORDSIZE; |
| usage(builtin_get_tar_commit_id_usage); |
| n = read_in_full(0, buffer, HEADERSIZE); |
| die("git get-tar-commit-id: read error"); |
| if (header->typeflag[0] != 'g') |
| if (!skip_prefix(content, "52 comment=", &comment)) |
| n = write_in_full(1, comment, 41); |
| die_errno("git get-tar-commit-id: write error"); |