aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgitk5
1 files changed, 2 insertions, 3 deletions
diff --git a/gitk b/gitk
index da84e22dd4..a19461561e 100755
--- a/gitk
+++ b/gitk
@@ -34,8 +34,7 @@ proc gitworktree {} {
# cdup to obtain a relative path to the top of the worktree. If
# run from the top, the ./ prefix ensures normalize expands pwd.
if {[catch { set _gitworktree $env(GIT_WORK_TREE) }]} {
- catch {set _gitworktree [exec git config --get core.worktree]}
- if {$_gitworktree eq ""} {
+ if {[catch {set _gitworktree [exec git config --get core.worktree]}]} {
set _gitworktree [file normalize ./[exec git rev-parse --show-cdup]]
}
}
@@ -12603,7 +12602,7 @@ set cdup {}
if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
set cdup [exec git rev-parse --show-cdup]
}
-set worktree [exec git rev-parse --show-toplevel]
+set worktree [gitworktree]
setcoords
makewindow
catch {