completion: support excluding refs
[gitweb.git] / t / t8008-blame-formats.sh
index d15f8b3d473416eaed24ed92396d567aa785c3d8..92c8e792d166ee37d5463de2bce32f61cfa570a1 100755 (executable)
@@ -5,7 +5,7 @@ test_description='blame output in various formats on a simple case'
 
 test_expect_success 'setup' '
        echo a >file &&
-       git add file
+       git add file &&
        test_tick &&
        git commit -m one &&
        echo b >>file &&
@@ -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