Skip to content

Commit 31ef388

Browse files
kbleesdscho
authored andcommitted
t800[12]: work around MSys limitation
MSys works very hard to convert Unix-style paths into DOS-style ones. *Very* hard. So hard, indeed, that git blame -L/hello/,/green/ is translated into something like git blame -LC:/msysgit/hello/,C:/msysgit/green/ As seen in msys_p2w in src\msys\msys\rt\src\winsup\cygwin\path.cc, line 3204ff: case '-': // // here we check for POSIX paths as attributes to a POSIX switch. // ... seemingly absolute POSIX paths in single-letter options get expanded by msys.dll unless they contain '=' or ';'. So a quick and very dirty fix is to use '-L/;*evil/'. (Using an equal sign works only when it is before a comma, so in the above example, /=*green/ would still be converted to a DOS-style path.) Commit-message-by: Johannes Schindelin <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 66a9c00 commit 31ef388

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

t/annotate-tests.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -263,27 +263,27 @@ test_expect_success 'blame -L X,-N' '
263263
'
264264

265265
test_expect_success 'blame -L /RE/ (RE to end)' '
266-
check_count -L/evil/ C 1 "A U Thor" 1
266+
check_count -L/\;*evil/ C 1 "A U Thor" 1
267267
'
268268

269269
test_expect_success 'blame -L /RE/,/RE2/' '
270-
check_count -L/robot/,/green/ A 1 B 1 B2 1 D 1 E 1
270+
check_count -L/\;*robot/,/\;*green/ A 1 B 1 B2 1 D 1 E 1
271271
'
272272

273273
test_expect_success 'blame -L X,/RE/' '
274-
check_count -L5,/evil/ B1 1 D 1 "A U Thor" 1
274+
check_count -L5,/\;*evil/ B1 1 D 1 "A U Thor" 1
275275
'
276276

277277
test_expect_success 'blame -L /RE/,Y' '
278-
check_count -L/99/,7 B1 1 D 1 "A U Thor" 1
278+
check_count -L/\;*99/,7 B1 1 D 1 "A U Thor" 1
279279
'
280280

281281
test_expect_success 'blame -L /RE/,+N' '
282-
check_count -L/99/,+3 B1 1 D 1 "A U Thor" 1
282+
check_count -L/\;*99/,+3 B1 1 D 1 "A U Thor" 1
283283
'
284284

285285
test_expect_success 'blame -L /RE/,-N' '
286-
check_count -L/99/,-3 B 1 B2 1 D 1
286+
check_count -L/\;*99/,-3 B 1 B2 1 D 1
287287
'
288288

289289
# 'file' ends with an incomplete line, so 'wc' reports one fewer lines than
@@ -349,31 +349,31 @@ test_expect_success 'blame -L multiple (superset/subset: unordered)' '
349349
'
350350

351351
test_expect_success 'blame -L /RE/ (relative)' '
352-
check_count -L3,3 -L/fox/ B1 1 B2 1 C 1 D 1 "A U Thor" 1
352+
check_count -L3,3 -L/\;*fox/ B1 1 B2 1 C 1 D 1 "A U Thor" 1
353353
'
354354

355355
test_expect_success 'blame -L /RE/ (relative: no preceding range)' '
356-
check_count -L/dog/ A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1
356+
check_count -L/\;*dog/ A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1
357357
'
358358

359359
test_expect_success 'blame -L /RE/ (relative: adjacent)' '
360-
check_count -L1,1 -L/dog/,+1 A 1 E 1
360+
check_count -L1,1 -L/\;*dog/,+1 A 1 E 1
361361
'
362362

363363
test_expect_success 'blame -L /RE/ (relative: not found)' '
364-
test_must_fail $PROG -L4,4 -L/dog/ file
364+
test_must_fail $PROG -L4,4 -L/\;*dog/ file
365365
'
366366

367367
test_expect_success 'blame -L /RE/ (relative: end-of-file)' '
368368
test_must_fail $PROG -L, -L/$/ file
369369
'
370370

371371
test_expect_success 'blame -L ^/RE/ (absolute)' '
372-
check_count -L3,3 -L^/dog/,+2 A 1 B2 1
372+
check_count -L3,3 -L^/\;*dog/,+2 A 1 B2 1
373373
'
374374

375375
test_expect_success 'blame -L ^/RE/ (absolute: no preceding range)' '
376-
check_count -L^/dog/,+2 A 1 B2 1
376+
check_count -L^/\;*dog/,+2 A 1 B2 1
377377
'
378378

379379
test_expect_success 'blame -L ^/RE/ (absolute: not found)' '

0 commit comments

Comments
 (0)