diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-07-09 01:17:09 -0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-07-09 01:17:09 -0400 |
commit | 0b81261622afad691501ee51d7811048cf4a5fce (patch) | |
tree | 0b2862469d7a162e11063bd2fe301c45331c27d2 /lib/index.tcl | |
parent | git-gui: Show a progress meter for checking out files (diff) | |
download | tgif-0b81261622afad691501ee51d7811048cf4a5fce.tar.xz |
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 <spearce@spearce.org>
Diffstat (limited to 'lib/index.tcl')
-rw-r--r-- | lib/index.tcl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/index.tcl b/lib/index.tcl index 7c175a96a6..3ea72e1ec9 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 \ |