Code

diff --stat: add config option to limit graph width
[git.git] / t / t4052-stat-output.sh
index d0ed0dc403cea1b539d72857e4f1ead4c957c254..328aa8f39865fb90d4b54991f158affa9cf2e1dc 100755 (executable)
@@ -101,6 +101,31 @@ respects expect200 show --stat
 respects expect200 log -1 --stat
 EOF
 
+cat >expect40 <<'EOF'
+ abcd | 1000 ++++++++++++++++++++++++++
+EOF
+
+while read verb expect cmd args
+do
+       test_expect_success "$cmd $verb not enough COLUMNS (big change)" '
+               COLUMNS=40 git $cmd $args >output
+               grep " | " output >actual &&
+               test_cmp "$expect" actual
+       '
+
+       test_expect_success "$cmd $verb statGraphWidth config" '
+               git -c diff.statGraphWidth=26 $cmd $args >output
+               grep " | " output >actual &&
+               test_cmp "$expect" actual
+       '
+done <<\EOF
+ignores expect80 format-patch -1 --stdout
+respects expect40 diff HEAD^ HEAD --stat
+respects expect40 show --stat
+respects expect40 log -1 --stat
+EOF
+
+
 cat >expect <<'EOF'
  abcd | 1000 ++++++++++++++++++++++++++
 EOF
@@ -117,6 +142,12 @@ do
                grep " | " output >actual &&
                test_cmp expect actual
        '
+
+       test_expect_success "$cmd --stat-graph--width with big change" '
+               git $cmd $args --stat-graph-width=26 >output
+               grep " | " output >actual &&
+               test_cmp expect actual
+       '
 done <<\EOF
 format-patch -1 --stdout
 diff HEAD^ HEAD --stat