git-gui: Handle failure of core.worktree to identify the working directory.
Commit 21985a11 'git-gui: handle non-standard worktree locations' attempts to use either GIT_WORK_TREE or core.worktree to set the _gitworktree variable but these may not be set which leads to a failure to launch gitk to review history. Use _gitdir to set the location for a standard git layout where the parent of the .git directory is the working tree. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Pat Thoyts committed
Jul 10, 2010 at 23:40 UTC
13a3d637b2d83fceb432fe7b9e21f8c4d882fa41
1 file changed
+3
git-gui.sh
+3
@@ -1158,6 +1158,9 @@ apply_config
1158
# try to set work tree from environment, falling back to core.worktree
1159
if {[catch { set _gitworktree $env(GIT_WORK_TREE) }]} {
1160
set _gitworktree [get_config core.worktree]
1161
+ if {$_gitworktree eq ""} {
1162
+ set _gitworktree [file dirname [file normalize $_gitdir]]
1163
+ }
1164
}
1165
if {$_prefix ne {}} {
1166
if {$_gitworktree eq {}} {