]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t8003-blame-corner-cases.sh
The sixth batch
[thirdparty/git.git] / t / t8003-blame-corner-cases.sh
index c92a47b6d5b11ab537ce9892ca21feddc19db7d9..9130b887d2cc45db769e1e5cbb0ddb1c32cf4b39 100755 (executable)
@@ -173,7 +173,6 @@ test_expect_success 'blame during cherry-pick with file rename conflict' '
        git show HEAD@{1}:rodent > rodent &&
        git add rodent &&
        git blame -f -C -C1 rodent | sed -e "$pick_fc" >current &&
-       cat current &&
        cat >expected <<-\EOF &&
        mouse-Initial
        mouse-Second
@@ -275,4 +274,40 @@ test_expect_success 'blame file with CRLF core.autocrlf=true' '
        grep "A U Thor" actual
 '
 
+# Tests the splitting and merging of blame entries in blame_coalesce().
+# The output of blame is the same, regardless of whether blame_coalesce() runs
+# or not, so we'd likely only notice a problem if blame crashes or assigned
+# blame to the "splitting" commit ('SPLIT' below).
+test_expect_success 'blame coalesce' '
+       cat >giraffe <<-\EOF &&
+       ABC
+       DEF
+       EOF
+       git add giraffe &&
+       git commit -m "original file" &&
+       oid=$(git rev-parse HEAD) &&
+
+       cat >giraffe <<-\EOF &&
+       ABC
+       SPLIT
+       DEF
+       EOF
+       git add giraffe &&
+       git commit -m "interior SPLIT line" &&
+
+       cat >giraffe <<-\EOF &&
+       ABC
+       DEF
+       EOF
+       git add giraffe &&
+       git commit -m "same contents as original" &&
+
+       cat >expect <<-EOF &&
+       $oid 1) ABC
+       $oid 2) DEF
+       EOF
+       git -c core.abbrev=40 blame -s giraffe >actual &&
+       test_cmp expect actual
+'
+
 test_done