summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-18 04:53:14 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-18 04:53:14 (GMT)
commit85d2d59760e5de7f288109cb278eb91da0d5f9bf (patch)
tree1bd8c58da334fce06da06b975d5553d84b294512 /lib
parentc52c94524bdf9bbe515137b7f3f0240bc10a7f63 (diff)
downloadgit-85d2d59760e5de7f288109cb278eb91da0d5f9bf.zip
git-85d2d59760e5de7f288109cb278eb91da0d5f9bf.tar.gz
git-85d2d59760e5de7f288109cb278eb91da0d5f9bf.tar.bz2
git-gui: Allow browser subcommand to start in subdirectory
Like our blame subcommand the browser subcommand now accepts both a revision and a path, just a revision or just a path. This way the user can start the subcommand on any branch, or on any subtree. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/browser.tcl10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/browser.tcl b/lib/browser.tcl
index 911e5af..e8802d0 100644
--- a/lib/browser.tcl
+++ b/lib/browser.tcl
@@ -13,13 +13,13 @@ field browser_busy 1
field ls_buf {}; # Buffered record output from ls-tree
-constructor new {commit} {
+constructor new {commit {path {}}} {
global cursor_ptr M1B
make_toplevel top w
wm title $top "[appname] ([reponame]): File Browser"
set browser_commit $commit
- set browser_path $browser_commit:
+ set browser_path $browser_commit:$path
label $w.path \
-textvariable @browser_path \
@@ -73,7 +73,11 @@ constructor new {commit} {
bind $w_list <Visibility> [list focus $w_list]
set w $w_list
- _ls $this $browser_commit
+ if {$path ne {}} {
+ _ls $this $browser_commit:$path $path
+ } else {
+ _ls $this $browser_commit $path
+ }
return $this
}