Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit edbc00e

Browse files
johnkeepinggitster
authored andcommitted
t4038: add tests for "diff --cc --raw <trees>"
Signed-off-by: John Keeping <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7766705 commit edbc00e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

t/t4038-diff-combined.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,28 @@ test_expect_success 'diagnose truncated file' '
8989
grep "diff --cc file" out
9090
'
9191

92+
test_expect_success 'setup for --cc --raw' '
93+
blob=$(echo file | git hash-object --stdin -w) &&
94+
base_tree=$(echo "100644 blob $blob file" | git mktree) &&
95+
trees= &&
96+
for i in `test_seq 1 40`
97+
do
98+
blob=$(echo file$i | git hash-object --stdin -w) &&
99+
trees="$trees$(echo "100644 blob $blob file" | git mktree)$LF"
100+
done
101+
'
102+
103+
test_expect_success 'check --cc --raw with four trees' '
104+
four_trees=$(echo "$trees" | sed -e 4q) &&
105+
git diff --cc --raw $four_trees $base_tree >out &&
106+
# Check for four leading colons in the output:
107+
grep "^::::[^:]" out
108+
'
109+
110+
test_expect_success 'check --cc --raw with forty trees' '
111+
git diff --cc --raw $trees $base_tree >out &&
112+
# Check for forty leading colons in the output:
113+
grep "^::::::::::::::::::::::::::::::::::::::::[^:]" out
114+
'
115+
92116
test_done

0 commit comments

Comments
 (0)