# [PATCH] Use git-rev-parse --git-dir to determine GIT_DIR

1 messages from 2006-11-30 to 2006-11-30. Participants: Peter Baumann.
Thread: https://gitlist.dev/t/43244

## Peter Baumann, 2006-11-30 16:45

Subject: [PATCH] Use git-rev-parse --git-dir to determine GIT_DIR
Message-ID: <20061130164543.GA11073@xp.machine.xx>
URL: https://gitlist.dev/e/20061130164543.GA11073%40xp.machine.xx

```
Signed-off-by: Peter Baumann <siprbaum@stud.informatik.uni-erlangen.de>
---
 gitk |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/gitk b/gitk
index ab383b3..60f8212 100755
--- a/gitk
+++ b/gitk
@@ -8,12 +8,7 @@ exec wish "$0" -- "$@"
 # either version 2, or (at your option) any later version.
 
 proc gitdir {} {
-    global env
-    if {[info exists env(GIT_DIR)]} {
-	return $env(GIT_DIR)
-    } else {
-	return ".git"
-    }
+    return [exec git rev-parse --git-dir]
 }
 
 proc start_rev_list {view} {
-- 
1.4.3.3

```
