diff --git a/git-gui.sh b/git-gui.sh index efa745dc48..84385c09a2 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1145,16 +1145,15 @@ if {[catch { set _prefix {} }] && [catch { - # beware that from the .git dir this sets _gitdir to . - # and _prefix to the empty string - set _gitdir [git rev-parse --git-dir] + # beware that from the .git dir this sets _prefix to the empty string + set _gitdir [git rev-parse --absolute-git-dir] set _prefix [git rev-parse --show-prefix] } err]} { load_config 1 apply_config choose_repository::pick if {[catch { - set _gitdir [git rev-parse --git-dir] + set _gitdir [git rev-parse --absolute-git-dir] } err]} { catch {wm withdraw .} error_popup [strcat [mc "Unusable repo/worktree:"] " [pwd] \n\n$err"] @@ -1175,13 +1174,6 @@ if {$hashalgorithm eq "sha1"} { exit 1 } -# we expand the _gitdir when it's just a single dot (i.e. when we're being -# run from the .git dir itself) lest the routines to find the worktree -# get confused -if {$_gitdir eq "."} { - set _gitdir [pwd] -} - if {![file isdirectory $_gitdir]} { catch {wm withdraw .} error_popup [strcat [mc "Git directory not found:"] "\n\n$_gitdir"]