summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorPat Thoyts <patthoyts@users.sourceforge.net>2010-07-10 22:40:59 (GMT)
committerPat Thoyts <patthoyts@users.sourceforge.net>2010-07-10 22:40:59 (GMT)
commit13a3d637b2d83fceb432fe7b9e21f8c4d882fa41 (patch)
treefdccc9ad85605d84ea4cbf69ca2daf93f66ee10c /git-gui.sh
parent2a9edd03057287cf7d69e5021eda2e0122684c92 (diff)
downloadgit-13a3d637b2d83fceb432fe7b9e21f8c4d882fa41.zip
git-13a3d637b2d83fceb432fe7b9e21f8c4d882fa41.tar.gz
git-13a3d637b2d83fceb432fe7b9e21f8c4d882fa41.tar.bz2
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>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 8996d2d..ec81b15 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1158,6 +1158,9 @@ apply_config
# try to set work tree from environment, falling back to core.worktree
if {[catch { set _gitworktree $env(GIT_WORK_TREE) }]} {
set _gitworktree [get_config core.worktree]
+ if {$_gitworktree eq ""} {
+ set _gitworktree [file dirname [file normalize $_gitdir]]
+ }
}
if {$_prefix ne {}} {
if {$_gitworktree eq {}} {