threads / patch / 25792

patchgit-gui: fix browsers [Up To Parent] in sub-sub-directories.

Subject: [PATCH] git-gui: fix browsers [Up To Parent] in sub-sub-directories.

## tl;dr

2 messages between Nov 19, 2010 and Nov 22, 2010. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Bert Wesarg· Nov 19, 2010, 20:43 UTC · lore

browser_path used to end with a slash, so the regexp matches the empty string and therefore removes nothing.

Fix this.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 git-gui/lib/browser.tcl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-gui/lib/browser.tcl +1 −1
diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
index c241572..a8c6223 100644
--- a/git-gui/lib/browser.tcl
+++ b/git-gui/lib/browser.tcl
@@ -121,7 +121,7 @@ method _parent {} {
 		if {$browser_stack eq {}} {
 			regsub {:.*$} $browser_path {:} browser_path
 		} else {
-			regsub {/[^/]+$} $browser_path {} browser_path
+			regsub {/[^/]+/$} $browser_path {/} browser_path
 		}
 		set browser_status [mc "Loading %s..." $browser_path]
 		_ls $this [lindex $parent 0] [lindex $parent 1]
-- 
tg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)
Pat Thoyts· Nov 22, 2010, 21:58 UTC · re: Bert Wesarg · lore

Re: [PATCH] git-gui: fix browsers [Up To Parent] in sub-sub-directories.

Bert Wesarg <bert.wesarg@googlemail.com> writes:
Show 24 quoted lines
>browser_path used to end with a slash, so the regexp matches the empty string
>and therefore removes nothing.
>
>Fix this.
>
>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>
>---
> git-gui/lib/browser.tcl |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
>index c241572..a8c6223 100644
>--- a/git-gui/lib/browser.tcl
>+++ b/git-gui/lib/browser.tcl
>@@ -121,7 +121,7 @@ method _parent {} {
> 		if {$browser_stack eq {}} {
> 			regsub {:.*$} $browser_path {:} browser_path
> 		} else {
>-			regsub {/[^/]+$} $browser_path {} browser_path
>+			regsub {/[^/]+/$} $browser_path {/} browser_path
> 		}
> 		set browser_status [mc "Loading %s..." $browser_path]
> 		_ls $this [lindex $parent 0] [lindex $parent 1]
Thanks - applied to git-gui master.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

← back to recent threads