Skip to content

Commit 8d7d33c

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a1638cf commit 8d7d33c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

t/t9350-fast-export.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,41 @@ test_expect_success 'tree_tag' '
540540
'
541541

542542
# 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.
543547
test_expect_success 'tree_tag-obj' 'git fast-export tree_tag-obj'
544548
test_expect_success 'tag-obj_tag' 'git fast-export tag-obj_tag'
545549
test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'
546550

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+
547578
test_expect_success 'directory becomes symlink' '
548579
git init dirtosymlink &&
549580
git init result &&

0 commit comments

Comments
 (0)