@@ -641,8 +641,8 @@ method _do_clone2 {} {
641
641
set pwd [pwd ]
642
642
if {[catch {
643
643
file mkdir [gitdir objects info]
644
- set f_in [open [file join $objdir info alternates] r]
645
- set f_cp [open [gitdir objects info alternates] w]
644
+ set f_in [safe_open_file [file join $objdir info alternates] r]
645
+ set f_cp [safe_open_file [gitdir objects info alternates] w]
646
646
fconfigure $f_in -translation binary -encoding binary
647
647
fconfigure $f_cp -translation binary -encoding binary
648
648
cd $objdir
@@ -727,7 +727,7 @@ method _do_clone2 {} {
727
727
[cb _do_clone_tags]
728
728
}
729
729
shared {
730
- set fd [open [gitdir objects info alternates] w]
730
+ set fd [safe_open_file [gitdir objects info alternates] w]
731
731
fconfigure $fd -translation binary
732
732
puts $fd $objdir
733
733
close $fd
@@ -760,8 +760,8 @@ method _copy_files {objdir tocopy} {
760
760
}
761
761
foreach p $tocopy {
762
762
if {[catch {
763
- set f_in [open [file join $objdir $p ] r]
764
- set f_cp [open [file join .git objects $p ] w]
763
+ set f_in [safe_open_file [file join $objdir $p ] r]
764
+ set f_cp [safe_open_file [file join .git objects $p ] w]
765
765
fconfigure $f_in -translation binary -encoding binary
766
766
fconfigure $f_cp -translation binary -encoding binary
767
767
@@ -818,12 +818,12 @@ method _clone_refs {} {
818
818
error_popup [mc " Not a Git repository: %s" [file tail $origin_url ]]
819
819
return 0
820
820
}
821
- set fd_in [git_read for-each-ref \
821
+ set fd_in [git_read [ list for-each-ref \
822
822
--tcl \
823
- {--format=list %(refname) %(objectname) %(*objectname)}]
823
+ {--format=list %(refname) %(objectname) %(*objectname)}]]
824
824
cd $pwd
825
825
826
- set fd [open [gitdir packed-refs] w]
826
+ set fd [safe_open_file [gitdir packed-refs] w]
827
827
fconfigure $fd -translation binary
828
828
puts $fd " # pack-refs with: peeled"
829
829
while {[gets $fd_in line] >= 0} {
@@ -877,7 +877,7 @@ method _do_clone_full_end {ok} {
877
877
878
878
set HEAD {}
879
879
if {[file exists [gitdir FETCH_HEAD]]} {
880
- set fd [open [gitdir FETCH_HEAD] r]
880
+ set fd [safe_open_file [gitdir FETCH_HEAD] r]
881
881
while {[gets $fd line] >= 0} {
882
882
if {[regexp "^(.{40})\t\t " $line line HEAD]} {
883
883
break
@@ -953,13 +953,14 @@ method _do_clone_checkout {HEAD} {
953
953
[mc " files" ]]
954
954
955
955
set readtree_err {}
956
- set fd [git_read --stderr read-tree \
956
+ set fd [git_read [ list read-tree \
957
957
-m \
958
958
-u \
959
959
-v \
960
960
HEAD \
961
961
HEAD \
962
- ]
962
+ ] \
963
+ [list 2>@1]]
963
964
fconfigure $fd -blocking 0 -translation binary
964
965
fileevent $fd readable [cb _readtree_wait $fd ]
965
966
}
0 commit comments