t9350: add tests for tags of things other than a commit

Multiple changes here: * add a test for a tag of a blob * add a test for a tag of a tag of a commit * add a comment to the tests for (possibly nested) tags of trees, making it clear that these tests are doing much less than you might expect Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Oct 3, 2019 at 13:27 UTC 8d7d33c1ce20066208b68bd75fd6d34e564f7229
1 file changed +31
t/t9350-fast-export.sh
+31
@@ -540,10 +540,41 @@ test_expect_success 'tree_tag' '
540 '
541
542 # NEEDSWORK: not just check return status, but validate the output
543 +# Note that these tests DO NOTHING other than print a warning that
544 +# they are ommitting the one tag we asked them to export (because the
545 +# tags resolve to a tree). They exist just to make sure we do not
546 +# abort but instead just warn.
547 test_expect_success 'tree_tag-obj' 'git fast-export tree_tag-obj'
548 test_expect_success 'tag-obj_tag' 'git fast-export tag-obj_tag'
549 test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'
550
551 +test_expect_success 'handling tags of blobs' '
552 + git tag -a -m "Tag of a blob" blobtag $(git rev-parse master:file) &&
553 + git fast-export blobtag >actual &&
554 + cat >expect <<-EOF &&
555 + blob
556 + mark :1
557 + data 9
558 + die Luft
559 +
560 + tag blobtag
561 + from :1
562 + tagger $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
563 + data 14
564 + Tag of a blob
565 +
566 + EOF
567 + test_cmp expect actual
568 +'
569 +
570 +test_expect_failure 'handling nested tags' '
571 + git tag -a -m "This is a nested tag" nested muss &&
572 + git fast-export --mark-tags nested >output &&
573 + grep "^from $ZERO_OID$" output &&
574 + grep "^tag nested$" output >tag_lines &&
575 + test_line_count = 2 tag_lines
576 +'
577 +
578 test_expect_success 'directory becomes symlink' '
579 git init dirtosymlink &&
580 git init result &&