3 test_description='git pack-object --include-tag'
8 test_expect_success setup '
10 git update-index --add d &&
11 tree=`git write-tree` &&
12 commit=`git commit-tree $tree </dev/null` &&
13 echo "object $commit" >sig &&
14 echo "type commit" >>sig &&
15 echo "tag mytag" >>sig &&
16 echo "tagger $(git var GIT_COMMITTER_IDENT)" >>sig &&
18 echo "our test tag" >>sig &&
19 tag=`git mktag <sig` &&
21 git update-ref refs/tags/mytag $tag && {
24 git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\) .*/\\1/"
29 test_expect_success 'pack without --include-tag' '
30 packname_1=$(git pack-objects \
35 test_expect_success 'unpack objects' '
40 git unpack-objects -n <test-1-${packname_1}.pack &&
41 git unpack-objects <test-1-${packname_1}.pack
45 test_expect_success 'check unpacked result (have commit, no tag)' '
46 git rev-list --objects $commit >list.expect &&
48 test_must_fail env GIT_DIR=clone.git git cat-file -e $tag &&
49 git rev-list --objects $commit
51 test_cmp list.expect list.actual
55 test_expect_success 'pack with --include-tag' '
56 packname_1=$(git pack-objects \
62 test_expect_success 'unpack objects' '
67 git unpack-objects -n <test-2-${packname_1}.pack &&
68 git unpack-objects <test-2-${packname_1}.pack
72 test_expect_success 'check unpacked result (have commit, have tag)' '
73 git rev-list --objects mytag >list.expect &&
77 git rev-list --objects $tag
79 test_cmp list.expect list.actual