@@ -410,9 +410,9 @@ proc rescan_stage2 {fd after} {
410
410
set fd_df [open " | git diff-files -z" r]
411
411
set fd_lo [open $ls_others r]
412
412
413
- fconfigure $fd_di -blocking 0 -translation binary
414
- fconfigure $fd_df -blocking 0 -translation binary
415
- fconfigure $fd_lo -blocking 0 -translation binary
413
+ fconfigure $fd_di -blocking 0 -translation binary -encoding binary
414
+ fconfigure $fd_df -blocking 0 -translation binary -encoding binary
415
+ fconfigure $fd_lo -blocking 0 -translation binary -encoding binary
416
416
fileevent $fd_di readable [list read_diff_index $fd_di $after ]
417
417
fileevent $fd_df readable [list read_diff_files $fd_df $after ]
418
418
fileevent $fd_lo readable [list read_ls_others $fd_lo $after ]
@@ -450,8 +450,9 @@ proc read_diff_index {fd after} {
450
450
451
451
incr c
452
452
set i [split [string range $buf_rdi $c [expr {$z1 - 2}]] { }]
453
+ set p [string range $buf_rdi $z1 [expr {$z2 - 1}]]
453
454
merge_state \
454
- [string range $buf_rdi $z1 [ expr { $z2 - 1}] ] \
455
+ [encoding convertfrom $p ] \
455
456
[lindex $i 4]? \
456
457
[list [lindex $i 0] [lindex $i 2]] \
457
458
[list ]
@@ -482,8 +483,9 @@ proc read_diff_files {fd after} {
482
483
483
484
incr c
484
485
set i [split [string range $buf_rdf $c [expr {$z1 - 2}]] { }]
486
+ set p [string range $buf_rdf $z1 [expr {$z2 - 1}]]
485
487
merge_state \
486
- [string range $buf_rdf $z1 [ expr { $z2 - 1}] ] \
488
+ [encoding convertfrom $p ] \
487
489
?[lindex $i 4] \
488
490
[list ] \
489
491
[list [lindex $i 0] [lindex $i 2]]
@@ -506,7 +508,7 @@ proc read_ls_others {fd after} {
506
508
set pck [split $buf_rlo " \0 " ]
507
509
set buf_rlo [lindex $pck end]
508
510
foreach p [lrange $pck 0 end-1] {
509
- merge_state $p ?O
511
+ merge_state [ encoding convertfrom $p ] ?O
510
512
}
511
513
rescan_done $fd buf_rlo $after
512
514
}
@@ -1459,6 +1461,7 @@ proc update_indexinfo {msg pathList after} {
1459
1461
-blocking 0 \
1460
1462
-buffering full \
1461
1463
-buffersize 512 \
1464
+ -encoding binary \
1462
1465
-translation binary
1463
1466
fileevent $fd writable [list \
1464
1467
write_update_indexinfo \
@@ -1499,7 +1502,7 @@ proc write_update_indexinfo {fd pathList totalCnt batch msg after} {
1499
1502
set info [lindex $s 2]
1500
1503
if {$info eq {}} continue
1501
1504
1502
- puts -nonewline $fd " $info \t $path \0 "
1505
+ puts -nonewline $fd " $info \t [ encoding convertto $path ] \0 "
1503
1506
display_file $path $new
1504
1507
}
1505
1508
@@ -1531,6 +1534,7 @@ proc update_index {msg pathList after} {
1531
1534
-blocking 0 \
1532
1535
-buffering full \
1533
1536
-buffersize 512 \
1537
+ -encoding binary \
1534
1538
-translation binary
1535
1539
fileevent $fd writable [list \
1536
1540
write_update_index \
@@ -1575,7 +1579,7 @@ proc write_update_index {fd pathList totalCnt batch msg after} {
1575
1579
?M {set new M_}
1576
1580
?? {continue }
1577
1581
}
1578
- puts -nonewline $fd " $path \0 "
1582
+ puts -nonewline $fd " [ encoding convertto $path ] \0 "
1579
1583
display_file $path $new
1580
1584
}
1581
1585
@@ -1613,6 +1617,7 @@ proc checkout_index {msg pathList after} {
1613
1617
-blocking 0 \
1614
1618
-buffering full \
1615
1619
-buffersize 512 \
1620
+ -encoding binary \
1616
1621
-translation binary
1617
1622
fileevent $fd writable [list \
1618
1623
write_checkout_index \
@@ -1645,7 +1650,7 @@ proc write_checkout_index {fd pathList totalCnt batch msg after} {
1645
1650
U? {continue }
1646
1651
?M -
1647
1652
?D {
1648
- puts -nonewline $fd " $path \0 "
1653
+ puts -nonewline $fd " [ encoding convertto $path ] \0 "
1649
1654
display_file $path ?_
1650
1655
}
1651
1656
}
0 commit comments