return [open |$run r]
}
-proc _lappend_nice {cmd_var} {
- global _nice
- upvar $cmd_var cmd
-
- if {![info exists _nice]} {
- set _nice [_which nice]
- if {[catch {safe_exec [list $_nice git version]}]} {
- set _nice {}
- }
- }
- if {$_nice ne {}} {
- lappend cmd $_nice
- }
-}
-
proc git {args} {
git_redir $args {}
}
return [safe_open_command $cmdp $redir]
}
-proc git_read_nice {cmd} {
- global _git
- set opt [list]
-
- _lappend_nice opt
-
- set cmdp [concat [list $_git] $cmd]
+set _nice [list [_which nice]]
+if {[catch {safe_exec [list {*}$_nice git version]}]} {
+ set _nice {}
+}
- return [safe_open_command [concat $opt $cmdp]]
+proc git_read_nice {cmd} {
+ set cmdp [list {*}$::_nice $::_git {*}$cmd]
+ return [safe_open_command $cmdp]
}
proc git_write {cmd} {