diff options
author | Elijah Newren <newren@gmail.com> | 2019-10-03 20:27:08 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-10-03 22:33:21 (GMT) |
commit | 8d7d33c1ce20066208b68bd75fd6d34e564f7229 (patch) | |
tree | b4258a2aa7d0c681f27eb0ea761711dea5c06f48 /t/t9350-fast-export.sh | |
parent | a1638cfe12ab06bd83068347ee8fc7a522c81e7b (diff) | |
download | git-8d7d33c1ce20066208b68bd75fd6d34e564f7229.zip git-8d7d33c1ce20066208b68bd75fd6d34e564f7229.tar.gz git-8d7d33c1ce20066208b68bd75fd6d34e564f7229.tar.bz2 |
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>
Diffstat (limited to 't/t9350-fast-export.sh')
-rwxr-xr-x | t/t9350-fast-export.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh index b3fca6f..9ab281e 100755 --- a/t/t9350-fast-export.sh +++ b/t/t9350-fast-export.sh @@ -540,10 +540,41 @@ test_expect_success 'tree_tag' ' ' # NEEDSWORK: not just check return status, but validate the output +# Note that these tests DO NOTHING other than print a warning that +# they are ommitting the one tag we asked them to export (because the +# tags resolve to a tree). They exist just to make sure we do not +# abort but instead just warn. test_expect_success 'tree_tag-obj' 'git fast-export tree_tag-obj' test_expect_success 'tag-obj_tag' 'git fast-export tag-obj_tag' test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj' +test_expect_success 'handling tags of blobs' ' + git tag -a -m "Tag of a blob" blobtag $(git rev-parse master:file) && + git fast-export blobtag >actual && + cat >expect <<-EOF && + blob + mark :1 + data 9 + die Luft + + tag blobtag + from :1 + tagger $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE + data 14 + Tag of a blob + + EOF + test_cmp expect actual +' + +test_expect_failure 'handling nested tags' ' + git tag -a -m "This is a nested tag" nested muss && + git fast-export --mark-tags nested >output && + grep "^from $ZERO_OID$" output && + grep "^tag nested$" output >tag_lines && + test_line_count = 2 tag_lines +' + test_expect_success 'directory becomes symlink' ' git init dirtosymlink && git init result && |