Merge branch 'tr/sha1-file-silence-loose-object-info-under-prune-race'
[gitweb.git] / t / t4205-log-pretty-formats.sh
index 88f24279851db9d0deee0b364d14d1ee18b77f50..26fbfde4a36689a51c181c13f9d5680fd2780219 100755 (executable)
@@ -143,6 +143,45 @@ EOF
        test_cmp expected actual
 '
 
+test_expect_success 'left alignment formatting with trunc' '
+       git log --pretty="format:%<(10,trunc)%s" >actual &&
+       # complete the incomplete line at the end
+       echo >>actual &&
+       qz_to_tab_space <<\EOF >expected &&
+message ..
+message ..
+add bar  Z
+initial  Z
+EOF
+       test_cmp expected actual
+'
+
+test_expect_success 'left alignment formatting with ltrunc' '
+       git log --pretty="format:%<(10,ltrunc)%s" >actual &&
+       # complete the incomplete line at the end
+       echo >>actual &&
+       qz_to_tab_space <<\EOF >expected &&
+..sage two
+..sage one
+add bar  Z
+initial  Z
+EOF
+       test_cmp expected actual
+'
+
+test_expect_success 'left alignment formatting with mtrunc' '
+       git log --pretty="format:%<(10,mtrunc)%s" >actual &&
+       # complete the incomplete line at the end
+       echo >>actual &&
+       qz_to_tab_space <<\EOF >expected &&
+mess.. two
+mess.. one
+add bar  Z
+initial  Z
+EOF
+       test_cmp expected actual
+'
+
 test_expect_success 'right alignment formatting' '
        git log --pretty="format:%>(40)%s" >actual &&
        # complete the incomplete line at the end
@@ -221,4 +260,18 @@ EOF
        test_cmp expected actual
 '
 
+test_expect_success 'left/right alignment formatting with stealing' '
+       git commit --amend -m short --author "long long long <long@me.com>" &&
+       git log --pretty="format:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
+       # complete the incomplete line at the end
+       echo >>actual &&
+       cat <<\EOF >expected &&
+short long  long long
+message ..   A U Thor
+add bar      A U Thor
+initial      A U Thor
+EOF
+       test_cmp expected actual
+'
+
 test_done