]>
Commit | Line | Data |
---|---|---|
8752d11d | 1 | # This file isn't used as a test script directly, instead it is |
9b01f003 | 2 | # sourced from t8001-annotate.sh and t8002-blame.sh. |
8752d11d | 3 | |
e8d08871 KB |
4 | if test_have_prereq MINGW |
5 | then | |
6 | sanitize_L () { | |
7 | echo "$1" | sed 'sX\(^-L\|,\)\^\?/X&\\;*Xg' | |
8 | } | |
9 | else | |
10 | sanitize_L () { | |
11 | echo "$1" | |
12 | } | |
13 | fi | |
14 | ||
92a903ac | 15 | check_count () { |
e37f39c1 | 16 | head= && |
5a9830cb | 17 | file='file' && |
03e15fc0 ES |
18 | options= && |
19 | while : | |
20 | do | |
21 | case "$1" in | |
22 | -h) head="$2"; shift; shift ;; | |
5a9830cb | 23 | -f) file="$2"; shift; shift ;; |
e8d08871 | 24 | -L*) options="$options $(sanitize_L "$1")"; shift ;; |
03e15fc0 ES |
25 | -*) options="$options $1"; shift ;; |
26 | *) break ;; | |
27 | esac | |
28 | done && | |
5a9830cb ES |
29 | echo "$PROG $options $file $head" >&4 && |
30 | $PROG $options $file $head >actual && | |
e37f39c1 | 31 | perl -e ' |
92a903ac | 32 | my %expect = (@ARGV); |
27eea66b | 33 | my %count = map { $_ => 0 } keys %expect; |
92a903ac JH |
34 | while (<STDIN>) { |
35 | if (/^[0-9a-f]+\t\(([^\t]+)\t/) { | |
36 | my $author = $1; | |
37 | for ($author) { s/^\s*//; s/\s*$//; } | |
27eea66b | 38 | $count{$author}++; |
92a903ac JH |
39 | } |
40 | } | |
41 | my $bad = 0; | |
42 | while (my ($author, $count) = each %count) { | |
43 | my $ok; | |
27eea66b KB |
44 | my $value = 0; |
45 | $value = $expect{$author} if defined $expect{$author}; | |
46 | if ($value != $count) { | |
92a903ac JH |
47 | $bad = 1; |
48 | $ok = "bad"; | |
49 | } | |
50 | else { | |
51 | $ok = "good"; | |
52 | } | |
27eea66b | 53 | print STDERR "Author $author (expected $value, attributed $count) $ok\n"; |
92a903ac JH |
54 | } |
55 | exit($bad); | |
e37f39c1 | 56 | ' "$@" <actual |
92a903ac JH |
57 | } |
58 | ||
e37f39c1 ES |
59 | test_expect_success 'setup A lines' ' |
60 | echo "1A quick brown fox jumps over the" >file && | |
61 | echo "lazy dog" >>file && | |
62 | git add file && | |
63 | GIT_AUTHOR_NAME="A" GIT_AUTHOR_EMAIL="A@test.git" \ | |
64 | git commit -a -m "Initial." | |
65 | ' | |
66 | ||
67 | test_expect_success 'blame 1 author' ' | |
68 | check_count A 2 | |
69 | ' | |
70 | ||
a544fb08 SG |
71 | test_expect_success 'blame in a bare repo without starting commit' ' |
72 | git clone --bare . bare.git && | |
73 | ( | |
74 | cd bare.git && | |
75 | check_count A 2 | |
76 | ) | |
77 | ' | |
78 | ||
7cb5f7c4 JK |
79 | test_expect_success 'blame by tag objects' ' |
80 | git tag -m "test tag" testTag && | |
81 | git tag -m "test tag #2" testTag2 testTag && | |
82 | check_count -h testTag A 2 && | |
83 | check_count -h testTag2 A 2 | |
84 | ' | |
85 | ||
e37f39c1 ES |
86 | test_expect_success 'setup B lines' ' |
87 | echo "2A quick brown fox jumps over the" >>file && | |
88 | echo "lazy dog" >>file && | |
89 | GIT_AUTHOR_NAME="B" GIT_AUTHOR_EMAIL="B@test.git" \ | |
90 | git commit -a -m "Second." | |
91 | ' | |
92 | ||
93 | test_expect_success 'blame 2 authors' ' | |
94 | check_count A 2 B 2 | |
95 | ' | |
96 | ||
97 | test_expect_success 'setup B1 lines (branch1)' ' | |
98 | git checkout -b branch1 master && | |
99 | echo "3A slow green fox jumps into the" >>file && | |
100 | echo "well." >>file && | |
101 | GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="B1@test.git" \ | |
102 | git commit -a -m "Branch1-1" | |
103 | ' | |
104 | ||
105 | test_expect_success 'blame 2 authors + 1 branch1 author' ' | |
106 | check_count A 2 B 2 B1 2 | |
107 | ' | |
108 | ||
109 | test_expect_success 'setup B2 lines (branch2)' ' | |
110 | git checkout -b branch2 master && | |
111 | sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new && | |
112 | mv file.new file && | |
113 | GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="B2@test.git" \ | |
114 | git commit -a -m "Branch2-1" | |
115 | ' | |
116 | ||
117 | test_expect_success 'blame 2 authors + 1 branch2 author' ' | |
118 | check_count A 2 B 1 B2 1 | |
119 | ' | |
120 | ||
121 | test_expect_success 'merge branch1 & branch2' ' | |
501a75a7 | 122 | git merge branch1 |
e37f39c1 ES |
123 | ' |
124 | ||
125 | test_expect_success 'blame 2 authors + 2 merged-in authors' ' | |
126 | check_count A 2 B 1 B1 2 B2 1 | |
127 | ' | |
128 | ||
95a4fb0e JK |
129 | test_expect_success 'blame --first-parent blames merge for branch1' ' |
130 | check_count --first-parent A 2 B 1 "A U Thor" 2 B2 1 | |
131 | ' | |
132 | ||
e37f39c1 ES |
133 | test_expect_success 'blame ancestor' ' |
134 | check_count -h master A 2 B 2 | |
135 | ' | |
136 | ||
137 | test_expect_success 'blame great-ancestor' ' | |
138 | check_count -h master^ A 2 | |
139 | ' | |
140 | ||
141 | test_expect_success 'setup evil merge' ' | |
142 | echo "evil merge." >>file && | |
143 | git commit -a --amend | |
144 | ' | |
145 | ||
146 | test_expect_success 'blame evil merge' ' | |
147 | check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1 | |
148 | ' | |
149 | ||
e228c173 JS |
150 | test_expect_success 'blame huge graft' ' |
151 | test_when_finished "git checkout branch2" && | |
152 | test_when_finished "rm -f .git/info/grafts" && | |
153 | graft= && | |
154 | for i in 0 1 2 | |
155 | do | |
156 | for j in 0 1 2 3 4 5 6 7 8 9 | |
157 | do | |
158 | git checkout --orphan "$i$j" && | |
159 | printf "%s\n" "$i" "$j" >file && | |
160 | test_tick && | |
161 | GIT_AUTHOR_NAME=$i$j GIT_AUTHOR_EMAIL=$i$j@test.git \ | |
162 | git commit -a -m "$i$j" && | |
163 | commit=$(git rev-parse --verify HEAD) && | |
164 | graft="$graft$commit " | |
165 | done | |
166 | done && | |
167 | printf "%s " $graft >.git/info/grafts && | |
168 | check_count -h 00 01 1 10 1 | |
169 | ' | |
170 | ||
e37f39c1 ES |
171 | test_expect_success 'setup incomplete line' ' |
172 | echo "incomplete" | tr -d "\\012" >>file && | |
173 | GIT_AUTHOR_NAME="C" GIT_AUTHOR_EMAIL="C@test.git" \ | |
174 | git commit -a -m "Incomplete" | |
175 | ' | |
176 | ||
177 | test_expect_success 'blame incomplete line' ' | |
178 | check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1 C 1 | |
179 | ' | |
180 | ||
181 | test_expect_success 'setup edits' ' | |
182 | mv file file.orig && | |
183 | { | |
184 | cat file.orig && | |
185 | echo | |
186 | } | sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" >file && | |
187 | echo "incomplete" | tr -d "\\012" >>file && | |
188 | GIT_AUTHOR_NAME="D" GIT_AUTHOR_EMAIL="D@test.git" \ | |
189 | git commit -a -m "edit" | |
190 | ' | |
191 | ||
192 | test_expect_success 'blame edits' ' | |
193 | check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 | |
194 | ' | |
195 | ||
196 | test_expect_success 'setup obfuscated email' ' | |
197 | echo "No robots allowed" >file.new && | |
198 | cat file >>file.new && | |
199 | mv file.new file && | |
200 | GIT_AUTHOR_NAME="E" GIT_AUTHOR_EMAIL="E at test dot git" \ | |
201 | git commit -a -m "norobots" | |
202 | ' | |
203 | ||
204 | test_expect_success 'blame obfuscated email' ' | |
205 | check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1 | |
206 | ' | |
03e15fc0 ES |
207 | |
208 | test_expect_success 'blame -L 1 (all)' ' | |
209 | check_count -L1 A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1 | |
210 | ' | |
211 | ||
212 | test_expect_success 'blame -L , (all)' ' | |
213 | check_count -L, A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1 | |
214 | ' | |
215 | ||
216 | test_expect_success 'blame -L X (X to end)' ' | |
217 | check_count -L5 B1 1 C 1 D 1 "A U Thor" 1 | |
218 | ' | |
219 | ||
220 | test_expect_success 'blame -L X, (X to end)' ' | |
221 | check_count -L5, B1 1 C 1 D 1 "A U Thor" 1 | |
222 | ' | |
223 | ||
224 | test_expect_success 'blame -L ,Y (up to Y)' ' | |
225 | check_count -L,3 A 1 B2 1 E 1 | |
226 | ' | |
227 | ||
228 | test_expect_success 'blame -L X,X' ' | |
229 | check_count -L3,3 B2 1 | |
230 | ' | |
231 | ||
232 | test_expect_success 'blame -L X,Y' ' | |
233 | check_count -L3,6 B 1 B1 1 B2 1 D 1 | |
234 | ' | |
235 | ||
236 | test_expect_success 'blame -L Y,X (undocumented)' ' | |
237 | check_count -L6,3 B 1 B1 1 B2 1 D 1 | |
238 | ' | |
239 | ||
5ce922a0 | 240 | test_expect_success 'blame -L -X' ' |
9527604f ES |
241 | test_must_fail $PROG -L-1 file |
242 | ' | |
243 | ||
5ce922a0 | 244 | test_expect_success 'blame -L 0' ' |
9527604f ES |
245 | test_must_fail $PROG -L0 file |
246 | ' | |
247 | ||
5ce922a0 | 248 | test_expect_success 'blame -L ,0' ' |
9527604f ES |
249 | test_must_fail $PROG -L,0 file |
250 | ' | |
251 | ||
5d57cac6 | 252 | test_expect_success 'blame -L ,+0' ' |
82cd7e5d ES |
253 | test_must_fail $PROG -L,+0 file |
254 | ' | |
255 | ||
abba3539 | 256 | test_expect_success 'blame -L X,+0' ' |
dedb9129 ES |
257 | test_must_fail $PROG -L1,+0 file |
258 | ' | |
259 | ||
03e15fc0 ES |
260 | test_expect_success 'blame -L X,+1' ' |
261 | check_count -L3,+1 B2 1 | |
262 | ' | |
263 | ||
264 | test_expect_success 'blame -L X,+N' ' | |
265 | check_count -L3,+4 B 1 B1 1 B2 1 D 1 | |
266 | ' | |
267 | ||
5d57cac6 | 268 | test_expect_success 'blame -L ,-0' ' |
82cd7e5d ES |
269 | test_must_fail $PROG -L,-0 file |
270 | ' | |
271 | ||
abba3539 | 272 | test_expect_success 'blame -L X,-0' ' |
dedb9129 ES |
273 | test_must_fail $PROG -L1,-0 file |
274 | ' | |
275 | ||
03e15fc0 ES |
276 | test_expect_success 'blame -L X,-1' ' |
277 | check_count -L3,-1 B2 1 | |
278 | ' | |
279 | ||
280 | test_expect_success 'blame -L X,-N' ' | |
281 | check_count -L6,-4 B 1 B1 1 B2 1 D 1 | |
282 | ' | |
283 | ||
284 | test_expect_success 'blame -L /RE/ (RE to end)' ' | |
285 | check_count -L/evil/ C 1 "A U Thor" 1 | |
286 | ' | |
287 | ||
288 | test_expect_success 'blame -L /RE/,/RE2/' ' | |
289 | check_count -L/robot/,/green/ A 1 B 1 B2 1 D 1 E 1 | |
290 | ' | |
291 | ||
292 | test_expect_success 'blame -L X,/RE/' ' | |
293 | check_count -L5,/evil/ B1 1 D 1 "A U Thor" 1 | |
294 | ' | |
295 | ||
296 | test_expect_success 'blame -L /RE/,Y' ' | |
297 | check_count -L/99/,7 B1 1 D 1 "A U Thor" 1 | |
298 | ' | |
299 | ||
300 | test_expect_success 'blame -L /RE/,+N' ' | |
301 | check_count -L/99/,+3 B1 1 D 1 "A U Thor" 1 | |
302 | ' | |
303 | ||
304 | test_expect_success 'blame -L /RE/,-N' ' | |
305 | check_count -L/99/,-3 B 1 B2 1 D 1 | |
306 | ' | |
307 | ||
580b4f3a ES |
308 | # 'file' ends with an incomplete line, so 'wc' reports one fewer lines than |
309 | # git-blame sees, hence the last line is actually $(wc...)+1. | |
310 | test_expect_success 'blame -L X (X == nlines)' ' | |
311 | n=$(expr $(wc -l <file) + 1) && | |
312 | check_count -L$n C 1 | |
313 | ' | |
314 | ||
164a9cf4 | 315 | test_expect_success 'blame -L X (X == nlines + 1)' ' |
580b4f3a ES |
316 | n=$(expr $(wc -l <file) + 2) && |
317 | test_must_fail $PROG -L$n file | |
318 | ' | |
319 | ||
03e15fc0 ES |
320 | test_expect_success 'blame -L X (X > nlines)' ' |
321 | test_must_fail $PROG -L12345 file | |
322 | ' | |
323 | ||
580b4f3a ES |
324 | test_expect_success 'blame -L ,Y (Y == nlines)' ' |
325 | n=$(expr $(wc -l <file) + 1) && | |
326 | check_count -L,$n A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1 | |
327 | ' | |
328 | ||
329 | test_expect_success 'blame -L ,Y (Y == nlines + 1)' ' | |
330 | n=$(expr $(wc -l <file) + 2) && | |
96cfa94e | 331 | check_count -L,$n A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1 |
580b4f3a ES |
332 | ' |
333 | ||
03e15fc0 | 334 | test_expect_success 'blame -L ,Y (Y > nlines)' ' |
96cfa94e | 335 | check_count -L,12345 A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1 |
03e15fc0 ES |
336 | ' |
337 | ||
91b5494e ES |
338 | test_expect_success 'blame -L multiple (disjoint)' ' |
339 | check_count -L2,3 -L6,7 A 1 B1 1 B2 1 "A U Thor" 1 | |
340 | ' | |
341 | ||
342 | test_expect_success 'blame -L multiple (disjoint: unordered)' ' | |
343 | check_count -L6,7 -L2,3 A 1 B1 1 B2 1 "A U Thor" 1 | |
344 | ' | |
345 | ||
346 | test_expect_success 'blame -L multiple (adjacent)' ' | |
347 | check_count -L2,3 -L4,5 A 1 B 1 B2 1 D 1 | |
348 | ' | |
349 | ||
350 | test_expect_success 'blame -L multiple (adjacent: unordered)' ' | |
351 | check_count -L4,5 -L2,3 A 1 B 1 B2 1 D 1 | |
352 | ' | |
353 | ||
354 | test_expect_success 'blame -L multiple (overlapping)' ' | |
355 | check_count -L2,4 -L3,5 A 1 B 1 B2 1 D 1 | |
356 | ' | |
357 | ||
358 | test_expect_success 'blame -L multiple (overlapping: unordered)' ' | |
359 | check_count -L3,5 -L2,4 A 1 B 1 B2 1 D 1 | |
360 | ' | |
361 | ||
362 | test_expect_success 'blame -L multiple (superset/subset)' ' | |
363 | check_count -L2,8 -L3,5 A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1 | |
364 | ' | |
365 | ||
366 | test_expect_success 'blame -L multiple (superset/subset: unordered)' ' | |
367 | check_count -L3,5 -L2,8 A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1 | |
368 | ' | |
369 | ||
52f4d126 ES |
370 | test_expect_success 'blame -L /RE/ (relative)' ' |
371 | check_count -L3,3 -L/fox/ B1 1 B2 1 C 1 D 1 "A U Thor" 1 | |
372 | ' | |
373 | ||
374 | test_expect_success 'blame -L /RE/ (relative: no preceding range)' ' | |
375 | check_count -L/dog/ A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1 | |
376 | ' | |
377 | ||
378 | test_expect_success 'blame -L /RE/ (relative: adjacent)' ' | |
379 | check_count -L1,1 -L/dog/,+1 A 1 E 1 | |
380 | ' | |
381 | ||
382 | test_expect_success 'blame -L /RE/ (relative: not found)' ' | |
383 | test_must_fail $PROG -L4,4 -L/dog/ file | |
384 | ' | |
385 | ||
386 | test_expect_success 'blame -L /RE/ (relative: end-of-file)' ' | |
387 | test_must_fail $PROG -L, -L/$/ file | |
388 | ' | |
389 | ||
a6ac5f98 ES |
390 | test_expect_success 'blame -L ^/RE/ (absolute)' ' |
391 | check_count -L3,3 -L^/dog/,+2 A 1 B2 1 | |
392 | ' | |
393 | ||
394 | test_expect_success 'blame -L ^/RE/ (absolute: no preceding range)' ' | |
395 | check_count -L^/dog/,+2 A 1 B2 1 | |
396 | ' | |
397 | ||
398 | test_expect_success 'blame -L ^/RE/ (absolute: not found)' ' | |
399 | test_must_fail $PROG -L4,4 -L^/tambourine/ file | |
400 | ' | |
401 | ||
402 | test_expect_success 'blame -L ^/RE/ (absolute: end-of-file)' ' | |
403 | n=$(expr $(wc -l <file) + 1) && | |
404 | check_count -L$n -L^/$/,+2 A 1 C 1 E 1 | |
405 | ' | |
406 | ||
5a9830cb ES |
407 | test_expect_success 'setup -L :regex' ' |
408 | tr Q "\\t" >hello.c <<-\EOF && | |
409 | int main(int argc, const char *argv[]) | |
410 | { | |
411 | Qputs("hello"); | |
412 | } | |
413 | EOF | |
414 | git add hello.c && | |
415 | GIT_AUTHOR_NAME="F" GIT_AUTHOR_EMAIL="F@test.git" \ | |
416 | git commit -m "hello" && | |
417 | ||
418 | mv hello.c hello.orig && | |
3a4fc21a RS |
419 | sed -e "/}/ {x; s/$/Qputs(\"goodbye\");/; G;}" <hello.orig | |
420 | tr Q "\\t" >hello.c && | |
5a9830cb ES |
421 | GIT_AUTHOR_NAME="G" GIT_AUTHOR_EMAIL="G@test.git" \ |
422 | git commit -a -m "goodbye" && | |
423 | ||
424 | mv hello.c hello.orig && | |
425 | echo "#include <stdio.h>" >hello.c && | |
426 | cat hello.orig >>hello.c && | |
99094a7a | 427 | tr Q "\\t" >>hello.c <<-\EOF && |
5a9830cb ES |
428 | void mail() |
429 | { | |
430 | Qputs("mail"); | |
431 | } | |
432 | EOF | |
433 | GIT_AUTHOR_NAME="H" GIT_AUTHOR_EMAIL="H@test.git" \ | |
434 | git commit -a -m "mail" | |
435 | ' | |
436 | ||
437 | test_expect_success 'blame -L :literal' ' | |
438 | check_count -f hello.c -L:main F 4 G 1 | |
439 | ' | |
440 | ||
441 | test_expect_success 'blame -L :regex' ' | |
442 | check_count -f hello.c "-L:m[a-z][a-z]l" H 4 | |
443 | ' | |
444 | ||
445 | test_expect_success 'blame -L :nomatch' ' | |
446 | test_must_fail $PROG -L:nomatch hello.c | |
447 | ' | |
448 | ||
1ce761a5 ES |
449 | test_expect_success 'blame -L :RE (relative)' ' |
450 | check_count -f hello.c -L3,3 -L:ma.. F 1 H 4 | |
451 | ' | |
452 | ||
453 | test_expect_success 'blame -L :RE (relative: no preceding range)' ' | |
454 | check_count -f hello.c -L:ma.. F 4 G 1 | |
455 | ' | |
456 | ||
457 | test_expect_success 'blame -L :RE (relative: not found)' ' | |
458 | test_must_fail $PROG -L3,3 -L:tambourine hello.c | |
459 | ' | |
460 | ||
461 | test_expect_success 'blame -L :RE (relative: end-of-file)' ' | |
462 | test_must_fail $PROG -L, -L:main hello.c | |
463 | ' | |
464 | ||
215e76c7 ES |
465 | test_expect_success 'blame -L ^:RE (absolute)' ' |
466 | check_count -f hello.c -L3,3 -L^:ma.. F 4 G 1 | |
467 | ' | |
468 | ||
469 | test_expect_success 'blame -L ^:RE (absolute: no preceding range)' ' | |
470 | check_count -f hello.c -L^:ma.. F 4 G 1 | |
471 | ' | |
472 | ||
473 | test_expect_success 'blame -L ^:RE (absolute: not found)' ' | |
474 | test_must_fail $PROG -L4,4 -L^:tambourine hello.c | |
475 | ' | |
476 | ||
477 | test_expect_success 'blame -L ^:RE (absolute: end-of-file)' ' | |
478 | n=$(printf "%d" $(wc -l <hello.c)) && | |
479 | check_count -f hello.c -L$n -L^:ma.. F 4 G 1 H 1 | |
480 | ' | |
481 | ||
a8fa8eca ES |
482 | test_expect_success 'setup incremental' ' |
483 | ( | |
484 | GIT_AUTHOR_NAME=I && | |
485 | export GIT_AUTHOR_NAME && | |
486 | GIT_AUTHOR_EMAIL=I@test.git && | |
487 | export GIT_AUTHOR_EMAIL && | |
488 | >incremental && | |
489 | git add incremental && | |
490 | git commit -m "step 0" && | |
491 | printf "partial" >>incremental && | |
492 | git commit -a -m "step 0.5" && | |
493 | echo >>incremental && | |
494 | git commit -a -m "step 1" | |
495 | ) | |
496 | ' | |
497 | ||
498 | test_expect_success 'blame empty' ' | |
499 | check_count -h HEAD^^ -f incremental | |
500 | ' | |
501 | ||
5ce922a0 ES |
502 | test_expect_success 'blame -L 0 empty' ' |
503 | test_must_fail $PROG -L0 incremental HEAD^^ | |
a8fa8eca ES |
504 | ' |
505 | ||
164a9cf4 | 506 | test_expect_success 'blame -L 1 empty' ' |
a8fa8eca ES |
507 | test_must_fail $PROG -L1 incremental HEAD^^ |
508 | ' | |
509 | ||
510 | test_expect_success 'blame -L 2 empty' ' | |
511 | test_must_fail $PROG -L2 incremental HEAD^^ | |
512 | ' | |
513 | ||
514 | test_expect_success 'blame half' ' | |
515 | check_count -h HEAD^ -f incremental I 1 | |
516 | ' | |
517 | ||
5ce922a0 ES |
518 | test_expect_success 'blame -L 0 half' ' |
519 | test_must_fail $PROG -L0 incremental HEAD^ | |
a8fa8eca ES |
520 | ' |
521 | ||
522 | test_expect_success 'blame -L 1 half' ' | |
523 | check_count -h HEAD^ -f incremental -L1 I 1 | |
524 | ' | |
525 | ||
164a9cf4 | 526 | test_expect_success 'blame -L 2 half' ' |
a8fa8eca ES |
527 | test_must_fail $PROG -L2 incremental HEAD^ |
528 | ' | |
529 | ||
530 | test_expect_success 'blame -L 3 half' ' | |
531 | test_must_fail $PROG -L3 incremental HEAD^ | |
532 | ' | |
533 | ||
534 | test_expect_success 'blame full' ' | |
535 | check_count -f incremental I 1 | |
536 | ' | |
537 | ||
5ce922a0 ES |
538 | test_expect_success 'blame -L 0 full' ' |
539 | test_must_fail $PROG -L0 incremental | |
a8fa8eca ES |
540 | ' |
541 | ||
542 | test_expect_success 'blame -L 1 full' ' | |
543 | check_count -f incremental -L1 I 1 | |
544 | ' | |
545 | ||
164a9cf4 | 546 | test_expect_success 'blame -L 2 full' ' |
a8fa8eca ES |
547 | test_must_fail $PROG -L2 incremental |
548 | ' | |
549 | ||
550 | test_expect_success 'blame -L 3 full' ' | |
551 | test_must_fail $PROG -L3 incremental | |
552 | ' | |
553 | ||
f350cf9e ES |
554 | test_expect_success 'blame -L' ' |
555 | test_must_fail $PROG -L file | |
556 | ' | |
557 | ||
558 | test_expect_success 'blame -L X,+' ' | |
559 | test_must_fail $PROG -L1,+ file | |
560 | ' | |
561 | ||
562 | test_expect_success 'blame -L X,-' ' | |
563 | test_must_fail $PROG -L1,- file | |
564 | ' | |
565 | ||
566 | test_expect_success 'blame -L X (non-numeric X)' ' | |
567 | test_must_fail $PROG -LX file | |
568 | ' | |
569 | ||
570 | test_expect_success 'blame -L X,Y (non-numeric Y)' ' | |
571 | test_must_fail $PROG -L1,Y file | |
572 | ' | |
573 | ||
574 | test_expect_success 'blame -L X,+N (non-numeric N)' ' | |
575 | test_must_fail $PROG -L1,+N file | |
576 | ' | |
577 | ||
578 | test_expect_success 'blame -L X,-N (non-numeric N)' ' | |
03e15fc0 ES |
579 | test_must_fail $PROG -L1,-N file |
580 | ' | |
a6ac5f98 ES |
581 | |
582 | test_expect_success 'blame -L ,^/RE/' ' | |
583 | test_must_fail $PROG -L1,^/99/ file | |
584 | ' |