Skip to content

Commit

Permalink
git-gui: Handle failure of core.worktree to identify the working dire…
Browse files Browse the repository at this point in the history
…ctory.

Commit 21985a1 '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>
  • Loading branch information
patthoyts committed Jul 10, 2010
1 parent 2a9edd0 commit 13a3d63
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}} {
Expand Down

0 comments on commit 13a3d63

Please sign in to comment.