diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-28 11:25:50 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-28 11:25:50 -0700 |
commit | 4966b58f3e1f295e3fb22560006b1db717b56f37 (patch) | |
tree | af3813c17a7bc43822bd9d7b0b6ca008eeff8789 /t | |
parent | 053e2fb5798374d1628b8cd4d797a64e48c944b6 (diff) | |
parent | 054a5aee6f3e8e90d96f7b3f76f5f55752561c59 (diff) | |
download | git-4966b58f3e1f295e3fb22560006b1db717b56f37.tar.gz git-4966b58f3e1f295e3fb22560006b1db717b56f37.tar.xz |
Merge branch 'js/find-commit-subject-ignore-leading-blanks' into maint
A helper function that takes the contents of a commit object and
finds its subject line did not ignore leading blank lines, as is
commonly done by other codepaths. Make it ignore leading blank
lines to match.
* js/find-commit-subject-ignore-leading-blanks:
reset --hard: skip blank lines when reporting the commit subject
sequencer: use skip_blank_lines() to find the commit subject
commit -C: skip blank lines at the beginning of the message
commit.c: make find_commit_subject() more robust
pretty: make the skip_blank_lines() function public
Diffstat (limited to 't')
-rwxr-xr-x | t/t8008-blame-formats.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t8008-blame-formats.sh b/t/t8008-blame-formats.sh index 29f84a6dd..92c8e792d 100755 --- a/t/t8008-blame-formats.sh +++ b/t/t8008-blame-formats.sh @@ -87,4 +87,21 @@ test_expect_success 'blame --line-porcelain output' ' test_cmp expect actual ' +test_expect_success '--porcelain detects first non-blank line as subject' ' + ( + GIT_INDEX_FILE=.git/tmp-index && + export GIT_INDEX_FILE && + echo "This is it" >single-file && + git add single-file && + tree=$(git write-tree) && + commit=$(printf "%s\n%s\n%s\n\n\n \noneline\n\nbody\n" \ + "tree $tree" \ + "author A <a@b.c> 123456789 +0000" \ + "committer C <c@d.e> 123456789 +0000" | + git hash-object -w -t commit --stdin) && + git blame --porcelain $commit -- single-file >output && + grep "^summary oneline$" output + ) +' + test_done |