Skip to contentSkip to conversation

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

PATCH In review Bert Wesarg 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

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

Fix this.

---
 git-gui/lib/browser.tcl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-gui/lib/browser.tcl +1 -1
index c241572..a8c6223 100644
@@ -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]
Signature · 1 line
tg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)
#1 lore raw
Quoted 16 lines · Bert Wesarg

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

Fix this.

---
git-gui/lib/browser.tcl | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
git-gui/lib/browser.tcl +0 -0
index c241572..a8c6223 100644

git-gui/lib/browser.tcl method _parent {} { · line 127

Quoted 8 lines
git-gui/lib/browser.tcl +1 -1
@@ -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.

Signature · 2 lines
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD