From df128139c690233e94ac249cf9d5271ac0d5f13d Mon Sep 17 00:00:00 2001 From: Heiko Voigt Date: Sun, 6 Feb 2011 18:22:46 +0100 Subject: [PATCH] git-gui: instead of defaulting to home directory use working directory When starting git gui in a non-git directory it presents the user a dialog which asks to create, clone or open a repository. The filedialogs used to choose the path(s) would always default to the home directory of the user. This patch changes this behavior and uses the current working directory in which git gui was started as default. This is useful in various cases. First being that the user starts the gui in some directory and can go search to create, open or clone a repository from there. Another use case is that tools like filemanager context menues can transport a natural default when selected from a folder. Users who like to have their home folder as a default can fall back on starting git gui with its working directory set to the home folder. Signed-off-by: Heiko Voigt Signed-off-by: Pat Thoyts --- lib/choose_repository.tcl | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl index fae119286d..657f7d5dc1 100644 --- a/lib/choose_repository.tcl +++ b/lib/choose_repository.tcl @@ -214,14 +214,6 @@ constructor pick {} { } } -proc _home {} { - if {[catch {set h $::env(HOME)}] - || ![file isdirectory $h]} { - set h . - } - return $h -} - method _center {} { set nx [winfo reqwidth $top] set ny [winfo reqheight $top] @@ -420,7 +412,7 @@ method _new_local_path {} { if {$local_path ne {}} { set p [file dirname $local_path] } else { - set p [_home] + set p [pwd] } set p [tk_chooseDirectory \ @@ -541,7 +533,7 @@ method _open_origin {} { if {$origin_url ne {} && [file isdirectory $origin_url]} { set p $origin_url } else { - set p [_home] + set p [pwd] } set p [tk_chooseDirectory \ @@ -1042,7 +1034,7 @@ method _open_local_path {} { if {$local_path ne {}} { set p $local_path } else { - set p [_home] + set p [pwd] } set p [tk_chooseDirectory \ -- 2.11.4.GIT