Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucian Poston <lucian.poston@gmail.com>2012-04-19 01:09:33 +0400
committerJunio C Hamano <gitster@pobox.com>2012-04-19 03:07:22 +0400
commitda79161db6dcb0643ab805e5cf78d7e4e34ce993 (patch)
tree930433fb23edd9ab40245c717e1532744b77e16c /t/t4052-stat-output.sh
parent36dcc02c52cb60c751338591dbb3bf4d9cf5a753 (diff)
t4052: Test diff-stat output with minimum columns
When COLUMNS or --stat-width restricts the diff-stat width to near the minimum, 26 columns, the graph_width value becomes negative. Consequently, the graph part of diff-stat is not resized properly. Signed-off-by: Lucian Poston <lucian.poston@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4052-stat-output.sh')
-rwxr-xr-xt/t4052-stat-output.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh
index d748e5e65c..b8eec8fd26 100755
--- a/t/t4052-stat-output.sh
+++ b/t/t4052-stat-output.sh
@@ -284,6 +284,34 @@ respects expect200 show --stat
respects expect200 log -1 --stat
EOF
+cat >expect1 <<'EOF'
+ ...aaaaaaa | 1000 ++++++
+EOF
+cat >expect1-graph <<'EOF'
+| ...aaaaaaa | 1000 ++++++
+EOF
+while read teststate verb expect cmd args
+do
+ test_expect_$teststate "$cmd $verb prefix greater than COLUMNS (big change)" '
+ COLUMNS=1 git $cmd $args >output
+ grep " | " output >actual &&
+ test_cmp "$expect" actual
+ '
+
+ test "$cmd" != diff || continue
+
+ test_expect_$teststate "$cmd --graph $verb prefix greater than COLUMNS (big change)" '
+ COLUMNS=1 git $cmd $args --graph >output
+ grep " | " output >actual &&
+ test_cmp "$expect-graph" actual
+ '
+done <<\EOF
+success ignores expect80 format-patch -1 --stdout
+failure respects expect1 diff HEAD^ HEAD --stat
+failure respects expect1 show --stat
+failure respects expect1 log -1 --stat
+EOF
+
cat >expect <<'EOF'
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EOF