From: Johan Herland Date: Sat, 09 Jun 2007 00:15:54 GMT Subject: [PATCH 08/21] Switch from verify_tag() to parse_and_verify_tag_buffer() for verifying tag objects in git-mktag Message-ID: <200706090215.54494.johan@herland.net> In-Reply-To: <200706090210.36270.johan@herland.net> This involves exposing parse_and_verify_tag_buffer() in the tag API (tag.h). Also synchronize selftest with change in error message. Signed-off-by: Johan Herland --- mktag.c | 5 ++--- t/t3800-mktag.sh | 2 +- tag.c | 2 +- tag.h | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mktag.c b/mktag.c index 2e70504..5780f33 100644 --- a/mktag.c +++ b/mktag.c @@ -125,9 +125,8 @@ int main(int argc, char **argv) } buffer[size] = 0; - /* Verify it for some basic sanity: it needs to start with - "object \ntype\ntagger " */ - if (verify_tag(buffer, size) < 0) + /* Verify tag object data */ + if (parse_and_verify_tag_buffer(0, buffer, size, 1)) die("invalid tag signature file"); if (write_sha1_file(buffer, size, tag_type, result_sha1) < 0) diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index b4edb4d..0e87d2a 100755 --- a/t/t3800-mktag.sh +++ b/t/t3800-mktag.sh @@ -34,7 +34,7 @@ too short for a tag EOF cat >expect.pat <