diff options
author | Jeff King <peff@peff.net> | 2018-08-22 20:50:17 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-23 10:08:51 -0700 |
commit | e5fba5d55886eaf48aeeb158dd4d30c2fc0294c9 (patch) | |
tree | 31eff0b791e7d3dbc8b270a69789ab363ba89577 /t/t4205-log-pretty-formats.sh | |
parent | interpret-trailers: allow suppressing "---" divider (diff) | |
download | tgif-e5fba5d55886eaf48aeeb158dd4d30c2fc0294c9.tar.xz |
pretty, ref-filter: format %(trailers) with no_divider option
In both of these cases we know that we are feeding the
trailer-parsing code a pure commit message. We should tell
it so, which avoids false positives for a commit message
that contains a "---" line.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4205-log-pretty-formats.sh')
-rwxr-xr-x | t/t4205-log-pretty-formats.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index 2052cadb11..978a8a66ff 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -598,4 +598,27 @@ test_expect_success ':only and :unfold work together' ' test_cmp expect actual ' +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 log --no-walk --format="%(trailers)" >actual && + test_cmp expect actual +' + test_done |