diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-09-17 22:53:54 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-17 22:53:54 +0200 |
commit | fba9654364a523bf146df26052ab05dd52c1d719 (patch) | |
tree | cf422aabddfa4c12069785a086e426a971e1ebe6 /t/t6300-for-each-ref.sh | |
parent | Merge branch 'sb/range-diff-colors' (diff) | |
parent | append_signoff: use size_t for string offsets (diff) | |
download | git-fba9654364a523bf146df26052ab05dd52c1d719.tar.xz git-fba9654364a523bf146df26052ab05dd52c1d719.zip |
Merge branch 'jk/trailer-fixes'
"git interpret-trailers" and its underlying machinery had a buggy
code that attempted to ignore patch text after commit log message,
which triggered in various codepaths that will always get the log
message alone and never get such an input.
* jk/trailer-fixes:
append_signoff: use size_t for string offsets
sequencer: ignore "---" divider when parsing trailers
pretty, ref-filter: format %(trailers) with no_divider option
interpret-trailers: allow suppressing "---" divider
interpret-trailers: tighten check for "---" patch boundary
trailer: pass process_trailer_opts to trailer_info_get()
trailer: use size_t for iterating trailer list
trailer: use size_t for string offsets
Diffstat (limited to 't/t6300-for-each-ref.sh')
-rwxr-xr-x | t/t6300-for-each-ref.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index 024f8c06f7..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 ' |