#!/bin/sh # # test_description='git-mktag: tag object verify test' . ./test-lib.sh ########################################################### # check the tag.sig file, expecting verify_tag() to fail, # and checking that the error message matches the pattern # given in the expect.pat file. check_verify_failure () { expect="$2" test_expect_success "$1" ' ( ! git-mktag message ) && grep -q "$expect" message ' } ########################################################### # first create a commit, so we have a valid object/type # for the tag. echo Hello >A git update-index --add A git-commit -m "Initial commit" head=$(git rev-parse --verify HEAD) ############################################################ # 1. length check cat >tag.sig <tag.sig <tag.sig <tag.sig <tag.sig printf "type tagsssssssssssssssssssssssssssssss" >>tag.sig check_verify_failure '"type" line eol check' '^error: char48: .*"\\n"$' ############################################################ # 6. tag line label check #1 cat >tag.sig <tag.sig <tag.sig <tag.sig <tag.sig <tag.sig <tag.sig <tag.sig <.git/refs/tags/mytag 2>message' ############################################################ # 14. check mytag test_expect_success \ 'check mytag' \ 'git-tag -l | grep mytag' test_done