diff options
author | 2012-05-02 13:53:28 -0700 | |
---|---|---|
committer | 2012-05-02 13:53:28 -0700 | |
commit | 29c2a3dbadaa1c2d1128a4892241f82f5b34778c (patch) | |
tree | e89235283655640030f481b6c8f5b6af77535650 /t/t4012-diff-binary.sh | |
parent | Merge branch 'pw/p4-various' (diff) | |
parent | diff --stat: use less columns for change counts (diff) | |
download | tgif-29c2a3dbadaa1c2d1128a4892241f82f5b34778c.tar.xz |
Merge branch 'zj/diff-stat-smaller-num-columns'
Spend only minimum number of columns necessary to show the number of lines
in the output from "diff --stat", instead of always allocating 4 columns
even when showing changes that are much smaller than 1000 lines.
By Zbigniew Jędrzejewski-Szmek
* zj/diff-stat-smaller-num-columns:
diff --stat: use less columns for change counts
Diffstat (limited to 't/t4012-diff-binary.sh')
-rwxr-xr-x | t/t4012-diff-binary.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh index ed24ddd88a..8b4e80de96 100755 --- a/t/t4012-diff-binary.sh +++ b/t/t4012-diff-binary.sh @@ -107,4 +107,23 @@ test_expect_success 'diff --no-index with binary creation' ' test_cmp expected actual ' +cat >expect <<EOF + binfile | Bin 0 -> 1026 bytes + textfile | 10000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +EOF + +test_expect_success 'diff --stat with binary files and big change count' ' + echo X | dd of=binfile bs=1k seek=1 && + git add binfile && + i=0 && + while test $i -lt 10000; do + echo $i && + i=$(($i + 1)) + done >textfile && + git add textfile && + git diff --cached --stat binfile textfile >output && + grep " | " output >actual && + test_cmp expect actual +' + test_done |