3 test_description='common tail optimization'
8 z="$z$z$z$z$z$z$z$z" ;# 64
9 z="$z$z$z$z$z$z$z$z" ;# 512
11 z2047=$(expr "$z" : '.\(.*\)') ; #2047
14 y="$x$x$x$x$x$x$x$x$x$x" ;# 100
15 z="$y$y$y$y$y$y$y$y$y$y" ;# 1000
22 while test "$count" -ge 1000
24 count=$(($count - 1000))
27 while test "$count" -ge 100
29 count=$(($count - 100))
32 while test "$count" -ge 10
34 count=$(($count - 10))
37 while test "$count" -ge 1
47 -e "s/QQQQQQQQQ/Z9000/g" \
48 -e "s/QQQQQQQQ/Z8000/g" \
49 -e "s/QQQQQQQ/Z7000/g" \
50 -e "s/QQQQQQ/Z6000/g" \
51 -e "s/QQQQQ/Z5000/g" \
57 -e "s/QQQQQQQQQ/Z900/g" \
58 -e "s/QQQQQQQQ/Z800/g" \
59 -e "s/QQQQQQQ/Z700/g" \
60 -e "s/QQQQQQ/Z600/g" \
68 -e "s/QQQQQQQQQ/Z90/g" \
69 -e "s/QQQQQQQQ/Z80/g" \
70 -e "s/QQQQQQQ/Z70/g" \
79 -e "s/QQQQQQQQQ/Z9/g" \
80 -e "s/QQQQQQQQ/Z8/g" \
95 diff --git a/file-a$cnt b/file-a$cnt
101 diff --git a/file-b$cnt b/file-b$cnt
107 diff --git a/file-c$cnt b/file-c$cnt
112 \ No newline at end of file
114 \ No newline at end of file
115 diff --git a/file-d$cnt b/file-d$cnt
124 sample='1023 1024 1025 2047 4095'
126 test_expect_success setup '
130 ( zs $n ; echo a ) >file-a$n &&
131 ( echo b; zs $n; echo ) >file-b$n &&
132 ( printf c; zs $n ) >file-c$n &&
133 ( echo d; zs $n ) >file-d$n &&
135 git add file-a$n file-b$n file-c$n file-d$n &&
137 ( zs $n ; echo A ) >file-a$n &&
138 ( echo B; zs $n; echo ) >file-b$n &&
139 ( printf C; zs $n ) >file-c$n &&
140 ( echo D; zs $n ) >file-d$n &&
142 expect_pattern $n || break
147 test_expect_success 'diff -U0' '
151 git diff -U0 file-?$n
153 test_cmp expect actual