From 0b81261622afad691501ee51d7811048cf4a5fce Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 9 Jul 2007 01:17:09 -0400 Subject: git-gui: Always use absolute path to all git executables Rather than making the C library search for git every time we want to execute it we now search for the main git wrapper at startup, do symlink resolution, and then always use the absolute path that we found to execute the binary later on. This should save us some cycles, especially on stat challenged systems like Cygwin/Win32. While I was working on this change I also converted all of our existing pipes ([open "| git ..."]) to use two new pipe wrapper functions. These functions take additional options like --nice and --stderr which instructs Tcl to take special action, like running the underlying git program through `nice` (if available) or redirect stderr to stdout for capture in Tcl. Signed-off-by: Shawn O. Pearce --- lib/index.tcl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/index.tcl') diff --git a/lib/index.tcl b/lib/index.tcl index 7c175a96a..3ea72e1ec 100644 --- a/lib/index.tcl +++ b/lib/index.tcl @@ -17,7 +17,7 @@ proc update_indexinfo {msg pathList after} { $update_index_cp \ $totalCnt \ 0.0] - set fd [open "| git update-index -z --index-info" w] + set fd [git_write update-index -z --index-info] fconfigure $fd \ -blocking 0 \ -buffering full \ @@ -90,7 +90,7 @@ proc update_index {msg pathList after} { $update_index_cp \ $totalCnt \ 0.0] - set fd [open "| git update-index --add --remove -z --stdin" w] + set fd [git_write update-index --add --remove -z --stdin] fconfigure $fd \ -blocking 0 \ -buffering full \ @@ -167,13 +167,13 @@ proc checkout_index {msg pathList after} { $update_index_cp \ $totalCnt \ 0.0] - set cmd [list git checkout-index] - lappend cmd --index - lappend cmd --quiet - lappend cmd --force - lappend cmd -z - lappend cmd --stdin - set fd [open "| $cmd " w] + set fd [git_write checkout-index \ + --index \ + --quiet \ + --force \ + -z \ + --stdin \ + ] fconfigure $fd \ -blocking 0 \ -buffering full \ -- cgit v1.2.1