Code

git-gui: Ensure submodule path is quoted properly
authorShawn O. Pearce <spearce@spearce.org>
Thu, 27 Aug 2009 00:39:45 +0000 (17:39 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 27 Aug 2009 00:42:50 +0000 (17:42 -0700)
When quoting an arbitrary user string in Tcl, its better to use
[list ...] than to use {...}, in case the user string has spaces
or { embedded within it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/diff.tcl

index d593323ae001e1a0f17e7550d52db152775e8806..bd5d189ed1ec1a6520b7e9fefc4d5d6f36b9a007 100644 (file)
@@ -300,9 +300,9 @@ proc start_show_diff {cont_info {add_opts {}}} {
         || [string match {160000 *} [lindex $s 3]]} {
                set is_submodule_diff 1
                if {$w eq $ui_index} {
-                       set cmd {submodule summary --cached -- $current_diff_path}
+                       set cmd [list submodule summary --cached -- $path]
                } else {
-                       set cmd {submodule summary --files -- $current_diff_path}
+                       set cmd [list submodule summary --files -- $path]
                }
        }