diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-01-29 03:09:28 -0500 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-01-29 03:09:28 -0500 |
commit | 8f6c07b902b297329e63799d5332758530ec4d99 (patch) | |
tree | e58b3147175750b05a4ed9b9e16be4e89a67e295 | |
parent | 463ca37b61b0d12aae8949c730bd38cc2149923f (diff) | |
download | git-8f6c07b902b297329e63799d5332758530ec4d99.tar.gz git-8f6c07b902b297329e63799d5332758530ec4d99.tar.xz |
git-gui: Correctly handle spaces in filepaths.
Anytime are about to open a pipe on what may be user data we need to
make sure the value is escaped correctly into a Tcl list, so that the
executed subprocess will receive the right arguments. For the most
part we were already doing this correctly, but a handful of locations
did not.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-x | git-gui.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git-gui.sh b/git-gui.sh index d5490cdde..160309b2c 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -3087,7 +3087,8 @@ proc ls_tree {w tree_id name} { lappend browser_stack($w) [list $tree_id $name] $w conf -state disabled - set fd [open "| git ls-tree -z $tree_id" r] + set cmd [list git ls-tree -z $tree_id] + set fd [open "| $cmd" r] fconfigure $fd -blocking 0 -translation binary -encoding binary fileevent $fd readable [list read_ls_tree $fd $w] } @@ -3247,7 +3248,8 @@ proc show_blame {commit path} { wm title $w "[appname] ([reponame]): File Viewer" set blame_data($w,total_lines) 0 - set fd [open "| git cat-file blob $commit:$path" r] + set cmd [list git cat-file blob "$commit:$path"] + set fd [open "| $cmd" r] fconfigure $fd -blocking 0 -translation lf -encoding binary fileevent $fd readable [list read_blame_catfile $fd $w $commit $path \ $texts $w.out.linenumber $w.out.file] |