diff options
Diffstat (limited to 't/t6300-for-each-ref.sh')
-rwxr-xr-x | t/t6300-for-each-ref.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index 48379aa0ee..97bfbee6e8 100755 --- a/t/t6300-for-each-ref.sh +++ b/t/t6300-for-each-ref.sh @@ -715,6 +715,29 @@ test_expect_success 'basic atom: head contents:trailers' ' test_cmp expect actual.clean ' +test_expect_success 'trailer parsing not fooled by --- line' ' + git commit --allow-empty -F - <<-\EOF && + this is the subject + + This is the body. The message has a "---" line which would confuse a + message+patch parser. But here we know we have only a commit message, + so we get it right. + + trailer: wrong + --- + This is more body. + + trailer: right + EOF + + { + echo "trailer: right" && + echo + } >expect && + git for-each-ref --format="%(trailers)" refs/heads/master >actual && + test_cmp expect actual +' + test_expect_success 'Add symbolic ref for the following tests' ' git symbolic-ref refs/heads/sym refs/heads/master ' @@ -795,4 +818,14 @@ test_expect_success ':remotename and :remoteref' ' ) ' +test_expect_success 'for-each-ref --ignore-case ignores case' ' + git for-each-ref --format="%(refname)" refs/heads/MASTER >actual && + test_must_be_empty actual && + + echo refs/heads/master >expect && + git for-each-ref --format="%(refname)" --ignore-case \ + refs/heads/MASTER >actual && + test_cmp expect actual +' + test_done |