Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] git-gui: fix browser with initial path

From: Pat Thoyts <hidden>
Date: 2016-06-15 22:50:28

Bert Wesarg [off-list ref] writes:
Ping.

On Tue, Nov 23, 2010 at 08:37, Bert Wesarg [off-list ref] wrote:
quoted
The path given to the browser does not end in a slash, which results in bad
path given to blame and broke [Up To Parent]. Also the path was not
escaped before displaying.

Signed-off-by: Bert Wesarg <redacted>

---
 git-gui/lib/browser.tcl |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
index c241572..a88a68b 100644
--- a/git-gui/lib/browser.tcl
+++ b/git-gui/lib/browser.tcl
@@ -26,8 +26,14 @@ constructor new {commit {path {}}} {
       wm withdraw $top
       wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]

+       if {$path ne {}} {
+               if {[string index $path end] ne {/}} {
+                       append path /
+               }
+       }
+
       set browser_commit $commit
-       set browser_path $browser_commit:$path
+       set browser_path "$browser_commit:[escape_path $path]"

       ${NS}::label $w.path \
               -textvariable @browser_path \
--
tg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)
The commit comment for this doesn't really reflect whats being
done. Commit 1ab8628 fixed the [Up To Parent] problem and this just
fixes the display on the browser title.

So I plan to take this with the commit comment as:

 git-gui: fix display of path in browser title

 Ensure the browser path is shown on the title with a / suffix and escape
 any backslashes or newlines in path elements before display.

 Signed-off-by: Bert Wesarg [off-list ref]

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help