3 test_description
='common tail optimization'
5 TEST_PASSES_SANITIZE_LEAK
=true
9 z
="$z$z$z$z$z$z$z$z" ;# 64
10 z
="$z$z$z$z$z$z$z$z" ;# 512
12 z2047
=$
(expr "$z" : '.\(.*\)') ; #2047
15 y
="$x$x$x$x$x$x$x$x$x$x" ;# 100
16 z
="$y$y$y$y$y$y$y$y$y$y" ;# 1000
23 while test "$count" -ge 1000
25 count
=$
(($count - 1000))
28 while test "$count" -ge 100
30 count
=$
(($count - 100))
33 while test "$count" -ge 10
35 count
=$
(($count - 10))
38 while test "$count" -ge 1
48 -e "s/QQQQQQQQQ/Z9000/g" \
49 -e "s/QQQQQQQQ/Z8000/g" \
50 -e "s/QQQQQQQ/Z7000/g" \
51 -e "s/QQQQQQ/Z6000/g" \
52 -e "s/QQQQQ/Z5000/g" \
58 -e "s/QQQQQQQQQ/Z900/g" \
59 -e "s/QQQQQQQQ/Z800/g" \
60 -e "s/QQQQQQQ/Z700/g" \
61 -e "s/QQQQQQ/Z600/g" \
69 -e "s/QQQQQQQQQ/Z90/g" \
70 -e "s/QQQQQQQQ/Z80/g" \
71 -e "s/QQQQQQQ/Z70/g" \
80 -e "s/QQQQQQQQQ/Z9/g" \
81 -e "s/QQQQQQQQ/Z8/g" \
96 diff --git a/file-a$cnt b/file-a$cnt
102 diff --git a/file-b$cnt b/file-b$cnt
108 diff --git a/file-c$cnt b/file-c$cnt
113 \ No newline at end of file
115 \ No newline at end of file
116 diff --git a/file-d$cnt b/file-d$cnt
125 sample
='1023 1024 1025 2047 4095'
127 test_expect_success setup
'
131 ( zs $n && echo a ) >file-a$n &&
132 ( echo b && zs $n && echo ) >file-b$n &&
133 ( printf c && zs $n ) >file-c$n &&
134 ( echo d && zs $n ) >file-d$n &&
136 git add file-a$n file-b$n file-c$n file-d$n &&
138 ( zs $n && echo A ) >file-a$n &&
139 ( echo B && zs $n && echo ) >file-b$n &&
140 ( printf C && zs $n ) >file-c$n &&
141 ( echo D && zs $n ) >file-d$n &&
143 expect_pattern $n || return 1
148 test_expect_success
'diff -U0' '
152 git diff -U0 file-?$n || return 1
154 test_cmp expect actual